|
|
|
|
|
by wild_egg
249 days ago
|
|
In Smalltalk those methods don't return `true`. They take a block and evaluate it if the boolean receiving the message (a > b) ifTrue: [ "do something" ]
EDIT: to clarify what's happening there, `>` is a message sent to `a` that will result in a boolean. The True class and False class both understand the ifTrue: message and `True>>ifTrue:` executes the block whereas `False>>ifTrue:` just throws it away.There's no `if` keyword in the language. Control flow is done purely through polymorphism. |
|