[squeak-dev] Block argument syntax
Jecel Assumpcao Jr.
jecel at merlintec.com
Fri Mar 1 18:48:23 UTC 2013
Just a quick reminder that this part of Smalltalk syntax came from Logo.
There you define a new function as
to spiral :length :angle
and most implementations (if not all) are ok with spaces between the ":"
and the argument names. This was an attempt to make the declaration
reflect usage (C style), where
"x means the symbol "x"
x means the function named "x"
thing "x means the value of the variable named "x"
:x is syntatic sugar for the previous case
In Smalltalk-72 and -74 the last option was also used in code, but that
got dropped in -76 and only the block declarations stayed unchanged all
the way to -80.
-- Jecel
More information about the Squeak-dev
mailing list
|