▲ | chao- 21 hours ago | ||||||||||||||||||||||
#if and #ifTrue are yours if you want them:
| |||||||||||||||||||||||
▲ | wild_egg 20 hours ago | parent [-] | ||||||||||||||||||||||
In Smalltalk those methods don't return `true`. They take a block and evaluate it if the boolean receiving the message
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. | |||||||||||||||||||||||
|