« Return to Thread: Io N00B - basic questions

Re: Io N00B - basic questions

by Friedrich Weber-3 :: Rate this Message:

Reply to Author | View in Thread

Hi,

the implementation of newSlot (which is the equivalent method to ::=)
does just create a very simple setter method:
http://github.com/stevedekorte/io/blob/master/libs/iovm/io/A2_Object.io#L337
You currently don't have to use the setter method, you can also use =
(which is updateSlot), but the setter method is handy for chaining.
Assuming that you did `myObject a ::= nil; myObject b ::= nil; myObject
c ::= nil` before:

myObject setA(123) setB(456) setC(789)

is the same as

myObject a = 123
myObject b = 456
myObject c = 789

but shorter :)

Regards,

Friedrich

 « Return to Thread: Io N00B - basic questions