From: Rick DeNatale Date: 2008-02-09T22:24:56+09:00 Subject: Re: Your own if/else On 2/9/08, Curt Sampson wrote: > Actually, I find the Smalltalk way a little more elegant. The booleans > have true:, false:, and true:false: methods; each of the parameters > takes a block: > > x > 3 true: [ 1 + 1 ] false [ 0 ] > > (If I recall correctly.) x > 3 ifTrue:[1 + 1] ifFalse:[0] However, most Smalltalk implementations cheat and the compiler turns this into test and branch bytecodes rather than sending the ifTrue:ifFalse: message -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/