[ANSI-Smalltalk] re: array creation syntax (was: expressing method signatures)

Damien Pollet damien.pollet at gmail.com
Wed Apr 16 21:26:31 BST 2008


2008/3/22 Andres Valloud <andres.valloud at gmail.com>:
> I think something that is being left unaddressed is whether using literal
> arrays that allow code expressions (e.g.: the brace syntax in Squeak) is a
> good practice or not.  In my experience, I have not felt the need for such
> things, but maybe I have not been exposed to particular circumstances in
> which they become useful.  Does anybody have some slam dunk examples that
> can be shared so that we can evaluate this better?

I find them useful for domain-specific languages, i.e. you want to
pass multiple runtime values to a method while making it look like a
keyword followed by a list. Cascade is the alternative but then you
need to keep track of state in the receiver, and an additional message
if you want a final treatment after all values are passed.

-- 
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet



More information about the ANSI-Smalltalk mailing list