S
Sylvain Joyeux
From the description,
---------------------------------------------------------------- Proc#==
prc == other_proc => true or false
------------------------------------------------------------------------
Return true if prc is the same object as other_proc, or if they
are both procs with the same body.
I thought that a == b in
=============================================
def block_to_proc(&prc)
prc
end
def test
block_to_proc do
end
end
a = test
b = test
=============================================
a == b (since both proc have the same body)
However, it returns false. So, the obvious question is: what does "if they
are both procs with the same body" mean ?
---------------------------------------------------------------- Proc#==
prc == other_proc => true or false
------------------------------------------------------------------------
Return true if prc is the same object as other_proc, or if they
are both procs with the same body.
I thought that a == b in
=============================================
def block_to_proc(&prc)
prc
end
def test
block_to_proc do
end
end
a = test
b = test
=============================================
a == b (since both proc have the same body)
However, it returns false. So, the obvious question is: what does "if they
are both procs with the same body" mean ?