Boolean expressions (was: Re: [squeak-dev] Re: Object>>#is:? (was: Re: PackageDependencyTest))

Bert Freudenberg bert at freudenbergs.de
Thu Mar 4 21:23:52 UTC 2010


On 04.03.2010, at 22:21, Stéphane Rollandin wrote:
> 
>> If you have a lot of protocols you can use the super fast
>> primitive supported #pointsTo: and have a lot cleaner (and possibly
>> faster) code:
>> 
>> is: aSymbol
>> 
>>  	^#(Morph MySpecializedMorph FooMorph BarMorph) pointsTo: aSymbol
>> 
> 
> 
> wow. thanks for the pointer, I wasn't aware of this one :)
> 
> Stef

It's also less readable. If you replace #pointsTo: with #includes: I know right away what it means. If you use this low-level optimization I have to think twice which object points where.

- Bert -





More information about the Squeak-dev mailing list