Project

General

Profile

Actions

Feature #13067

closed

TrueClass,FalseClass to provide `===` to match truthy/falsy values.

Added by matz (Yukihiro Matsumoto) almost 8 years ago. Updated almost 5 years ago.

Status:
Closed
Target version:
-
[ruby-dev:49916]

Description

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #11286: [PATCH] Add case equality arity to Enumerable's sequence predicates.Closedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0