j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
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@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.
squeak-dev@lists.squeakfoundation.org