< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #13067 has been updated by jonathanhefner (Jonathan Hefner).
Although I like the minimalism and cleverness of `:itself.to_proc`, I don't think it reads as nicely. It also does not `inspect` nicely. For example,
```ruby
raise "value does not match #{pattern.inspect}" unless pattern === value
```
Does not give a nice error message when `pattern` is `:itself.to_proc`.
Also, when you specifically want to match falsy values, `:itself.to_proc` must become `:!.to_proc`, which may not be obvious.
So, I think constants like `TRUTHY` and `FALSEY` would be helpful. Although they might not be appropriate as top-level constants. While trying to think of where they should be defined, I had the crazy idea of `TrueClass#thy` and `FalseClass#y`. In other words, `true.thy == TRUTHY` and `false.y == FALSEY`. That is too asymmetric and gimmicky, I think, but what about `true.ish == TRUTHY` and `false.ish == FALSEY`?
----------------------------------------
Feature #13067: TrueClass,FalseClass to provide `===` to match truthy/falsy values.
https://bugs.ruby-lang.org/issues/13067#change-84185
* Author: matz (Yukihiro Matsumoto)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
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/