Project

General

Profile

Actions

Feature #12515

closed

Create "Boolean" superclass of TrueClass / FalseClass

Added by lsegal (Loren Segal) over 8 years ago. Updated over 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:76107]

Description

Since Ruby 2.4 is unifying Bignum/Fixnum into Integer (https://bugs.ruby-lang.org/issues/12005), it seems reasonable to do something similar for TrueClass / FalseClass, and create a proper Boolean hierarchy. The implementation would be fairly straightforward and should be back compat unless someone already has a "Boolean" class at toplevel out there.

Given the compatibility implications of Integer, this Boolean proposal is even less intrusive.

Sample implementation:

class Boolean < BasicObject; end
class TrueClass < Boolean; end
class FalseClass < Boolean; end

Related issues 3 (1 open2 closed)

Related to Ruby master - Feature #20756: Introduce Boolean classRejectedActions
Related to Ruby master - Feature #20882: Provide Boolean(...)OpenActions
Has duplicate Ruby master - Bug #12827: Add Boolean data type.RejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0