[Pharo-project] Compiler pedantic about ifNotNil: argument

Igor Stasenko siguctua at gmail.com
Sun Oct 10 09:16:52 EDT 2010


On 10 October 2010 16:13, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> personnally I do not like this form
> What does it do?
>
>>    process ifNotNil: #terminate.
>

here the test case for it:

| process answer |

process := Object new.

answer := process ifNotNil: #terminate.

self assert: answer == #terminate.


>
> for me it means passes the symbol #terminate as argument to the method ifNotNil:
> If it has a more magical behavior then I do not know it.
>
> Stef
>
>
>> The compiler uselessly insist on #ifNotNil: argument being a zero/one arg block.
>> Thus we cannot write this xtream sentence
>>
>>    process ifNotNil: #terminate.
>>
>> When the argument is not a block, Compiler should avoid inlining and
>> just send a normal message.
>>
>> cheers
>>
>> Nicolas
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project at lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.




More information about the Pharo-dev mailing list