#at:ifAbsentPutValue[Of]:

James Foster james at foster.net
Mon Aug 31 15:37:44 UTC 1998


Would it be too wordy to add a preposition? Is it more readable? Is the
increased readability worth the extra typing?

self at: aKey ifAbsentPutValue: aBlock
self at: aKey ifAbsentPutValueOf: aBlock

James Foster
Fargo, ND

-----Original Message-----
From: David N. Smith <dnsmith at watson.ibm.com>
Date: Friday, August 28, 1998 12:10 PM
Subject: Re: Polymorphism without protocol dilution


><SNIP>
>Don't mix blocks
>and other values. Make the protocol different. For example:
>
>   at: key ifAbsentPut: anObject
>      self at: key ifAbsent: [ self at: key put: anObject ]
>
>
>   at: key ifAbsentPutValue: aBlock
>      self at: key ifAbsent: [ self at: key put: aBlock value ]
>
>
>Another effect of this suggestion is that it still allows putting blocks
>into dictionaries as values, while suggestions 1 and 2 do not.
>
>
>Dave
>_______________________________
>David N. Smith
>IBM T J Watson Research Center
>Hawthorne, NY
>_______________________________
>Any opinions or recommendations
>herein are those of the author
>and not of his employer.
>





More information about the Squeak-dev mailing list