News for hackers. Stuff that matters.
Re:Whats New in PHP 8.2 by masklinn on Monday April 25, 2022 @01:56PM (#31158411)
> That's just wrong. Boolean is the type. False is just one possibile value of that type.

Having false and true be singleton types is perfectly cromulent.

That's how Smalltalk has been doing it for 40 years, and why it can do without control structures:

    Boolean subclass: False [
        ifTrue: trueBlock ifFalse: falseBlock [
            ^falseBlock value
        ]
        "..."


    Boolean subclass: True [
        ifTrue: trueBlock ifFalse: falseBlock [
            ^trueBlock value
        ]
        "..."

There are no comments on this comment yet.