Re:Alan Kay on the Meaning of “Object-Oriented Programming” ...
by gambler on Tuesday March 19, 2019 @01:04PM
(#19432821)
>`ifTrue` and `else` are extension methods added to the `Boolean` type.
You don't seem to understand what this discussion is about. Extension functions in Kotlin are statically dispatched, so while they are a nice feature, they are completely irrelevant here.
It's not about how your invocation code looks like. The important part is that at some point the code needs to make a decision whether to invoke "if" case or "else" case. Smalltalk achieves this by having two objects/classes (True and False) that handle the same message differently. The implementation of those objects does not have a hidden control flow statement. Your code would.
`ifTrue` and `else` are extension methods added to the `Boolean` type.
You know that there have been new developments in PLT since Smalltalk, right?