2 ms·
In Smalltalk, `;` does two things: terminates the current message (EDIT: while ignoring its return value) and propagates the target object of the current messag
by klibertp 2y ago
In 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.