Sake = Rake for Smalltalk?

stéphane ducasse ducasse at iam.unibe.ch
Tue May 16 19:35:35 UTC 2006


> ColoredPoint >> [ foo:aFoo bar:aBar |
>    self doStuff.
> ]
>
> This way, >> is really a message with a block argument, and one  
> could do:
>
> aBlock := [ foo:aFoo bar:aBar | self blah ].
> aBlock foo:42 bar:51.
> Maybe #foo:bar: should just be an alias for #value:value in this
> precise instance of Block, instead of defining a new method in Block.
>
> The current syntax ("anonymous" blocks) could still be allowed as
> syntactic shortcut:
> aBlock := [ :x :y | self blah ].
> being synonymous for:
> aBlock := [ value:x value:y | self blah ].

Quite neat! even if I dislike the |

> Also, what should self be in the context of a script ?  In a (VW)
> workspace it's an undefined object...

Nothing





More information about the Squeak-dev mailing list