On Thu, 2 Dec 2010, Peter van Rooijen wrote:
I agree,
If you want to know if a object is the same object as that designated by the expression nil, you use the message #== (this message had guaranteed semantics since it can not be redefined).
If you want to know if the message ifNil: aBlock sent to the object evaluates the block argument, you use the message #ifNil: (which could do anything it has been defined to do - at least, I would hope so!).
Those two uses are distinct and mean something different.
In theory yes, but the compiler also inlines #ifNil:, #ifNil:ifNotNil:, #ifNotNil: and #ifNotNil:ifNil: if the arguments are literal blocks. So in that case, they are equivalent with == nil ifTrue:/ifFalse:. Levente
Cheers, Peter
On Mon, 22 Nov 2010 21:08:23 +0100, <pharo@googlecode.com> wrote:
Comment #12 on issue 1594 by patchi...@gmail.com: refactor to use #ifNil: http://code.google.com/p/pharo/issues/detail?id=1594
It would be great to review this issue cause it's on Accepted state and i lots of ppl don't agree with it.
Ocurrences of = nil or ~= nil were no more than ten but there're at least 800+ ocurrences of == nil or ~~ nil in PharoCore image so far.
-- Peter van Rooijen Nijlring 83 5152 VJ Drunen m: 06-2854 2048