[squeak-dev] Block argument syntax

Ron Teitelbaum ron at usmedrec.com
Fri Mar 1 14:48:41 UTC 2013


Hi Frank,

I know this is true for a number of Smalltalk implementations.  I found it
very surprising also.  Someone I worked with always formatted their code
this way.  He said it made it easier to double click and highlight the
variable.  I wasn't sure that was enough reason to do it but he did.

Ron

> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of Frank Shearar
> 
> I was rather surprised to learn that the following is valid syntax:
> 
>     [ : x | x + 1]
> 
> (Note the space before the argument name.)
> 
> In fact, this is too:
> 
>     [ : "This is a really long comment in a very, very strange place.
> It makes it very hard to see that the : before this comment turns the
token after
> this comment into a block argument." x | x + 1]
> 
> Is that intentional? Does ANSI Smalltalk define it?
> 
> frank
> 




More information about the Squeak-dev mailing list