>> 
>> 
>> Now to me this looks like a hack and again it works because now Symbol are 
>> valuable objects.
>> Too many hacks will only make the system more hackish.
>> And especially the
>>        iftrue: 'foo' ifFalse: 'zork'
>> 
> 
> This is not a hack, because if you refer to implementation:
> 
> True>>ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock
>       ^trueAlternativeBlock value
> 
> False>>ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock
>       ^falseAlternativeBlock value
> 
> so, it answers either 'foo' value , or 'zork' value.
> And #value could be sent to any object in system:
> 
> Object>>value
>       ^self
> 
> What actually shown here is a use of duck typing, because any object,
> which implemets #value, could be safely passed
> as argument to #ifTrue:ifFalse: message.
> It is well consistent with language design.

I know well that. and it sucks from a language semantics point of view.
I agree with the mail of lukas.

Stef
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to