Smalltalk's favorite Boolean method

How is this effectively different than:

if 1 == 2
   puts "true!"
else
   puts "false!"
end

???

Dan

···

-----Original Message-----
From: list-bounce@example.com
[mailto:list-bounce@example.com] On Behalf Of Ernest Micklei
Sent: Tuesday, April 11, 2006 7:13 AM
To: ruby-talk ML
Subject: Smalltalk's favorite Boolean method

Hi,

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!"]

or even

   1 == 2 ?
     puts('true'):
     puts('false')

lean. mean. :wink:

-a

···

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

-----Original Message-----
From: list-bounce@example.com
[mailto:list-bounce@example.com] On Behalf Of Ernest Micklei
Sent: Tuesday, April 11, 2006 7:13 AM
To: ruby-talk ML
Subject: Smalltalk's favorite Boolean method

Hi,

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

--
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama