Actions
Bug #22498
closedProc#== does not return true for the same lexical code block
Bug #22498:
Proc#== does not return true for the same lexical code block
Description
The current documentation of Proc#== in Ruby 4 says self == other "returns whether self and other were created from the same code block." However, the following code shows otherwise:
Note that here we have both f returning the code block from the same Ruby code, but they are considered different. A more reliable way to determine the equalness of procs, although only working in CRuby, is
I don't think the current behavior is necessarily wrong, but the documentation must be misleading if the current behavior is intended.
Actions