Menu

#205 Tuple fields cannot be changed

None
assigned
None
urgent
major
Always
OCL expressions
5.2
Windows
2020-05-03
2020-05-02
No

! create c:Customer
! c.title:='Prof.'
! c.name:='Martin Gogolla'
? c.title
? c.name
? c.title + ' ' + c.name
-> 'Prof. Martin Gogolla' : String
-- OK!

! t:= Tuple{title='Prof.', name='Martin Gogolla'}
? t.title
? t.name
? t.title + ' ' + t.name
-> 'Prof. Martin Gogolla' : String
-- Also OK!

! t.title:= 'Professor'
<input>:1:0: Expected expression with object type, found type `Tuple(title:String,name:String)'.
-- Not OK, because t.title is a String, not an object type.

Discussion

  • QUASAR research group

    This is a particularly urgent issue for my students. If tuple fields cannot be changed, its usage is much limited.
    Thank you in advance for your attention!
    Fernando Brito e Abreu
    (ISCTE-IUL, Lisbon, Portugal)

     
  • Andreas Kaestner

    • status: new --> assigned
    • assigned_to: Andreas Kaestner
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.