From: samuel@... Date: 2016-11-14T03:36:40+00:00 Subject: [ruby-core:78113] [Ruby trunk Feature#12515] Create "Boolean" superclass of TrueClass / FalseClass Issue #12515 has been updated by Samuel Williams. Nobu, thanks for that clarification. I was not aware of that. If that's the only issue holding back this feature, I'm sure a workaround can be found that works appropriately. It might be as simple as going with the more common option `class Boolean` and breaking when people define `module Boolean` in the global namespace, which in practice is very small percentage, and already represents a problem when people try to include code which does it both ways, and for which the preferred way is most certainly `class Boolean`. Another option is to include in the standard library a `boolean.rb` which defines set semantics for what people are already doing. If you include this yourself, and other code breaks, it's your own fault. ---------------------------------------- Feature #12515: Create "Boolean" superclass of TrueClass / FalseClass https://bugs.ruby-lang.org/issues/12515#change-61478 * Author: Loren Segal * Status: Rejected * Priority: Normal * Assignee: ---------------------------------------- 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 ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: