On Fri, 13 Jul 2001, Keith Hodges wrote: > Dear Matz, thanks for your replies > > In the discussion appended below (that I have now unearthed) the usefulness of a "message > consuming nil" is presented. I believe that Objective-C uses this approach. I personally > use ST/X by exept.de and I have yet to get this pattern working in this environment > either (due to the fact that the compiler inlines the ifTrue:ifFalse: behaviour and you > cant redefine it. (it works in the interpreter though) It might be worth pointing out that in Objective-C, like Ruby and unlike Smalltalk, if-statements are not considered message sends, and so don't/shouldn't follow the message-consuming-nil behavior; in ObjC, a nil is treated as false in an if statement, just as it currently is in Ruby. It's an interesting debate; in theory I side with the exception-throwing-nil view, although I have to admit I never had any problems with it when I did a lot of ObjC, and it lead to some interesting idioms - for example, when writing [mutex lock]; ... [mutex unlock]; these became no-ops if you were running single threaded and your mutex was set to nil.