Hacker News new | ask | show | jobs
by fzzzy 4840 days ago
Yes. Smalltalk has the ifTrue: and ifFalse: methods on the Boolean object.

  x > y ifTrue: [ Transcript show: 'Truthy' ]
So it is using polymorphism as the main mechanism. The True object implements ifTrue: by evaluating the block argument and implements ifFalse: by doing nothing. The False object does the opposite.