[#49896] 未知の、実キーワード引数の扱いの慣例 — "KISHIMOTO, Makoto" <ksmakoto@...4u.or.jp>
きしもとです
1 message
2016/12/05
[ruby-dev:49919] [Ruby trunk Feature#13067] TrueClass, FalseClass to provide `===` to match truthy/falsy values.
From:
nobu@...
Date:
2016-12-25 01:22:23 UTC
List:
ruby-dev #49919
Issue #13067 has been updated by Nobuyoshi Nakada. It affects `case`/`when` clause too, and breaks optparse and rubygems at least. ---------------------------------------- Feature #13067: TrueClass,FalseClass to provide `===` to match truthy/falsy values. https://bugs.ruby-lang.org/issues/13067#change-62234 * Author: Yukihiro Matsumoto * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- I propose to make `TrueClass`, `FalseClass` to provide `===` method to match truthy values (`TrueClass`), and falsy values (`FalseClass`), so that we can use true and false for case pattern matching. And we can pick truthy values using `grep` e.g. `ary.grep(true)`. Matz. -- https://bugs.ruby-lang.org/