Issue #12515 has been updated by Shyouhei Urabe.


Samuel Williams wrote:
> If that's the only issue holding back this feature.

Sadly no.  The reason why this is not accepted is matz do not like the idea.  You have to persuade him.

> 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.

What's wrong with a gem, in that case?  Raise of rubygems made it harder today than past to introduce a new standard library.

----------------------------------------
Feature #12515: Create "Boolean" superclass of TrueClass / FalseClass
https://bugs.ruby-lang.org/issues/12515#change-61510

* 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>