|
|
|
|
|
by isaachier
2647 days ago
|
|
Here's an example of the distinct nature of Smalltalk's message passing: Control structures Control structures do not have special syntax in Smalltalk. They are instead implemented as messages sent to objects. For example, conditional execution is implemented by sending the message ifTrue: to a Boolean object, passing as an argument the block of code to be executed if and only if the Boolean receiver is true. The following code demonstrates this: result := a > b ifTrue:[ 'greater' ] ifFalse:[ 'less or equal' ] https://en.wikipedia.org/wiki/Smalltalk |
|
For example in Kotlin: