true is the unique instance of class Truefalse is the unique instance of class FalseIn Pharo, booleans have nothing special
false & (1 error: 'crazy')
-> an error(1 error: 'crazy') is executed because this is a non lazy operator false and: [ 1 error: 'crazy' ]
-> false "no error!"[1 error: 'crazy'] is not executed because it is not necessaryIn Pharo, traditional conditional (if, else, while) are messages sent to boolean or block objects
Weather isRaining
ifTrue: [ self takeMyUmbrella ]
ifFalse: [ self takeMySunglasses ]ifTrue:ifFalse: is a message sent to an object: a boolean!true is the unique instance of the class Truefalse is the unique instance of the class False
More details in a future lecture (The Essence of Dispatch)
ifTrue: [ ] and ifTrue: [ ] ifFalse: [ ] are two different messages
forceItalicOrOblique
self slantValue = 0
ifTrue: [ slantValue := 1 ]fullName isEmptyOrNil
ifTrue: [ 'FirstnameLastname' translated ]
ifFalse: [ fullName ].
ifFalse: [ ] and ifFalse: [ ] ifTrue: [ ] are two different messages
myProtocol
ifEmpty: [ 'As yet unclassified' ]self listItems
ifNotEmpty: [ :aList | aList at: index ]/