[ANSI-Smalltalk] A list of interesting methods, not present in the ANSI standard

John Dougan jdougan at acm.org
Thu Mar 20 08:27:33 GMT 2008


Ralph Johnson wrote:
>> Object>>ifNil:
>>  Object>>ifNil:ifNotNil:
>>  Object>>ifNotNil:
>>  Object>>ifNotNil:ifNil:
>>     
>
> These were widely used by the time the standard was written, but not
> part of every image, and i imagine the committee decided that it
> wasn't worth the effort to put them in the standard.  However, I don't
> think they are controversial, either.  Since then, they have become
> even more widely used.
>   
There actually is a minor controversy here as the VisualWorks version of 
these has the block for the ifNotNil: clauses take an optional 
argument.  I discovered while porting a large-ish chunk of VW code to 
Squeak/Croquet that the Squeak version does not take the optional 
argument and it's a compiler change to make it do so as these methods 
are optimized out.

I personally think the VW approach is bad style and a possible 
efficiency issue. I ended up implementing Squeak's version of the one 
argument ifNotNil: in VW, which is ifNotNilDo: .

Cheers,
 -- John

-- 
John Dougan
jdougan at acm.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openskills.org/pipermail/ansi-smalltalk/attachments/20080320/78d4c731/attachment.htm


More information about the ANSI-Smalltalk mailing list