[ENH][CCP] CCP002-OCAtIfAbsentPut
ducasse
ducasse at iam.unibe.ch
Sun Nov 16 22:30:52 UTC 2003
Hi marcus
I just wanted to know
why don't you define it as:
at: anIndex ifAbsentPut: aBlock
^self at: anIndex ifAbsent: [self at: anIndex put: aBlock value]
I compared with VW and this is fun because this method is not defined
on OC but one subclasses
of KeyedCollection.
Stef
On Dimanche, nov 16, 2003, at 16:38 Europe/Zurich, marcus at ira.uka.de
wrote:
> from preamble:
>
> "Change Set: OCAtIfAbsentPut
> Date: 14 November 2003
> Author: Marcus Denker
>
> This changeset adds at:ifAbsentPut: to OrderedCollection
>
> The comment:
>
> Return value at index, however, if value does not exist (nil or out of
> bounds) then add block's value at index (growing self if necessary)
>
> This is used by the ClosureCompiler (IRBuilder)
> "!
> <CCP002-OCAtIfAbsentPut.cs.gz>
More information about the Squeak-dev
mailing list
|