[#66126] Creation/Conversion methods/functions table for Ruby types — SASADA Koichi <ko1@...>
Hi,
5 messages
2014/11/07
[#66248] [ruby-trunk - Feature #10423] [PATCH] opt_str_lit*: avoid literal string allocations — normalperson@...
Issue #10423 has been updated by Eric Wong.
3 messages
2014/11/13
[#66595] [ruby-trunk - Bug #10557] [Open] Block not given when the argument is a string — bartosz@...
Issue #10557 has been reported by Bartosz Kopinski.
3 messages
2014/11/30
[ruby-core:66277] [ruby-trunk - Feature #10426] A predicate to express congruence
From:
nobu@...
Date:
2014-11-14 02:11:08 UTC
List:
ruby-core #66277
Issue #10426 has been updated by Nobuyoshi Nakada.
How about `similar?` or `analog?` ?
----------------------------------------
Feature #10426: A predicate to express congruence
https://bugs.ruby-lang.org/issues/10426#change-49950
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
----------------------------------------
I occasionally felt the necessity of a predicate that checks congruence with respect to some operations:
~~~ruby
class Object
def equal_by? other, &pr
pr.call(self) == pr.call(other)
end
alias congruent? equal_by?
end
5.congruent?(2){|e| e % 3} #=> true
"HELLO".equal_by?("Hello", &:downcase) #=> true
~~~
--
https://bugs.ruby-lang.org/