Re: Smalltalk's favorite Boolean method


#1

For a long time I have been programming Smalltalk.
Recently, Ruby “got me” and I was wondering how the
famous ifTrue:ifFalse: could be added to the System.

1 = 2
ifTrue:
[Transcript show: “true!” ]
ifFalse:
[Transcript show: “false!”]

How is this effectively different than:

if 1 == 2
puts “true!”
else
puts “false!”
end

???

Dan


#2

On Tue, 11 Apr 2006, Berger, Daniel wrote:

For a long time I have been programming Smalltalk.

if 1 == 2
puts “true!”
else
puts “false!”
end

or even

1 == 2 ?
puts(‘true’):
puts(‘false’)

lean. mean. :wink:

-a