[squeak-dev] Re: Future of Squeak, and outsider's view

Igor Stasenko siguctua at gmail.com
Tue Jun 30 14:39:43 UTC 2009


2009/6/30 Klaus D. Witzel <klaus.witzel at cobss.com>:
> On Tue, 30 Jun 2009 07:15:37 +0200, Igor Stasenko wrote:
>
>> Since multiple people seem don't grok my example, let me simplify it a
>> bit:
>>
>> Suppose you have a special collection of objects over which you can
>> iterate.
>>
>> The items in that collection could be anything - you don't really care
>> on almost any of them, except those ones which is also a special
>> collections of same kind as a container.
>>
>> so, then you could have a method, which by iterating through your
>> special collection, ignores all objects except those who
>> also can be iterated in same manner:
>>
>> MySpecialCollection>>mySpecialCollect: aBlock
>>     ^ self collect: [:each |
>>          each isMySpecialCollection ifTrue: [ each mySpecialCollect:
>> aBlock] ifFalse: [each]
>>      ]
>
> In _any_ Smalltalk, (each respondsTo: #mySpecialCollect:) is what you want.
>

where the guarantees that some completely different class does not
implements such method with completely different behavior?

>>
>
>
> --
> "If at first, the idea is not absurd, then there is no hope for it". Albert
> Einstein
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list