2 ms·
It is using ';' instead of parenthesizing the messages to the objects, correct?
by zelphirkalt 2y ago
It is using ';' instead of parenthesizing the messages to the objects, correct?
- klibertp 2y agoIn Smalltalk, `;` does two things: terminates the current message (EDIT: while ignoring its return value) and propagates the target object of the current message as a target for the following message. So this: scene add: sprite; add: otherSprite; setBackGround: stage; start is equivalent to: scene add: sprite. scene add: otherSprite. scene setBackGround: stage. scene start. In Dart, they use `..` prefix instead of `;` postfix: https://dart.dev/language/operators#cascade-notation https://dart.dev/language/operators#cascade-notation var paint = Paint() ..color = Colors.black ..strokeCap = StrokeCap.round ..strokeWidth = 5.0; You can model this with monads easily, but it's just one, very limited application of them - monads are much more general.