[ruby-core:77848] [Ruby trunk Feature#12515] Create "Boolean" superclass of TrueClass / FalseClass
From:
nobu@...
Date:
2016-11-01 02:59:10 UTC
List:
ruby-core #77848
Issue #12515 has been updated by Nobuyoshi Nakada. Samuel Williams wrote: > > It's a choice by that library author. They are not classes but methods, there can be `Boolean` method in the library. > > Nobu, you are not looking deep enough. > > https://github.com/jeremyevans/sequel/blob/c39594dd35b3f8a8975b05be156ba664f1630804/lib/sequel/database/schema_generator.rb#L57-L61 It seems specific to the context, and should be defined there. ---------------------------------------- Feature #12515: Create "Boolean" superclass of TrueClass / FalseClass https://bugs.ruby-lang.org/issues/12515#change-61160 * 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>