[#77789] [Ruby trunk Feature#12012] Add Boolean method — prodis@...
Issue #12012 has been updated by Fernando Hamasaki de Amorim.
4 messages
2016/10/27
[ruby-core:77839] [Ruby trunk Feature#12515] Create "Boolean" superclass of TrueClass / FalseClass
From:
rr.rosas@...
Date:
2016-10-31 14:51:43 UTC
List:
ruby-core #77839
Issue #12515 has been updated by Rodrigo Rosenfeld Rosas. Actually, this isn't a good example as it would return TrueClass or FalseClass rather than Boolean... ---------------------------------------- Feature #12515: Create "Boolean" superclass of TrueClass / FalseClass https://bugs.ruby-lang.org/issues/12515#change-61151 * 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:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>