"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Thursday, February 26, 2004

Explaining ifTrue:ifFalse:

The challenge is expressed this way...

try explaining to someone how Smalltalk's ifTrue:ifFalse: works sometime

The message looks like this...
someObject ifTrue: [someCode] ifFalse: [otherCode].

See if my attempt makes sense to you:

If someObject is true, then someCode is executed. Otherwise otherCode is executed.

Is that basic enough for non-Smalltalkers?

No comments:

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.