Issue #13067 has been updated by Robert A. Heiler.


> 4) Increases the confusion of true vs "truthy" and false vs "falsey"

I think that the words "true" and "false" are a lot easier to understand than "truthy" and "falsy".

There should be some document that states the valid values for these in ruby.

Off the top of my head, true being everything except for:

- nil
- false

Perhaps I missed something, but that seems to be like a very small list to remember for
what is false? I am confused about the confusion comment. I guess the part about code
that breaks is a valid concern though. There is a long way to go for ruby 3.x anyway. ;)

----------------------------------------
Feature #13067: TrueClass,FalseClass to provide `===` to match truthy/falsy values.
https://bugs.ruby-lang.org/issues/13067#change-62341

* Author: Yukihiro Matsumoto
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* 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/