2010/10/10 Igor Stasenko <[email protected]>: > On 10 October 2010 16:13, Stéphane Ducasse <[email protected]> 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. >
Ah, yes, I did not interpret it the same... I asked my son, which is not a Smalltalker, what he understood, and it was (process terminate) not (^#terminate). Nicolas > >> >> 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 >>> [email protected] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
