[squeak-dev] Block argument syntax

Frank Shearar frank.shearar at gmail.com
Fri Mar 1 20:11:18 UTC 2013


On 1 March 2013 15:39, Yoshiki Ohshima <Yoshiki.Ohshima at acm.org> wrote:
> I believe I have seen Dan Ingalls posted about the syntax here
> before...  The essence of the message was that a block is still like a
> method, and they kind of have keyword message pattern, except that the
> keyword part is null (0-length) string.  In this regard, allowing
> spaces after a colon follows the principle.
>
> I thought that why we don't allow keywords longer than 0, actually.
> One could say:
>
> [keyword1: arg1 keyword2: arg2 | ...]
>
> to annotate each parameter of a block.

That actually makes a lot of sense. It's like an anonymous selector.

I'm still not going to write [ : x | x ] though! Ugly! Odd that in
heading on 15 years of looking at Smalltalk, and reading Smalltalk
Best Practice Patterns I've never seen it before.

frank

> --
> -- Yoshiki
>


More information about the Squeak-dev mailing list