[Pharo-project] Compiler pedantic about ifNotNil: argument

Stéphane Ducasse stephane.ducasse at inria.fr
Sun Oct 10 09:21:06 EDT 2010


On Oct 10, 2010, at 3:17 PM, Igor Stasenko wrote:

> 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.

all that to avoid to have 

	ifNotNil: [#terminate]

I would not change the ifNotNil: for that.
But make the compiler smarter

Stef

> 
> 
>> 
>> 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.
> 
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project





More information about the Pharo-dev mailing list