[squeak-dev] Re: [Question] nil, true, false in array literals

Claus Kick claus_kick at web.de
Fri Dec 5 19:06:27 UTC 2008


Stéphane Rollandin wrote:

> 
>> And FWIW, in GNU Smalltalk even though #(...) is obviously valid, I
>> removed the #(abc) shortcut for symbols.  The only words without sharps
>> are exactly true, false, nil.
>>
>> Paolo
> 
> 
> OTOH the current behavior in Squeak allows fun things, such as having 
> lisp code cleanly stored as an array of symbol:
> 
> prog := #(funcall (lambda (x) (sqrt x)) 5) asCons

and then you do something like this
(anArray at:1) perform: ((anArray at:2) at:1) ? :)

Aside:
In my book, the ability to having objects perform symbols is one of the 
drawbacks of Smalltalk, if done in actual production code.

At my former job, there was stuff like

doSomething: anArgument

(anArgument kindOf: aClass) ifTrue:[sel := aClass, '_', 'performer'].
anArgument perform: (sel asSymbol).

Have fun debugging this ...



More information about the Squeak-dev mailing list