J
Jamis Buck
I noticed, today, that Proc#dup fails ("allocator undefined for Proc"),
but Proc#clone works.
Is this expected behavior?
$ ruby -ve "p proc { |a| puts 1 }.dup"
ruby 1.8.2 (2004-07-29) [i686-linux]
-e:1:in `dup': allocator undefined for Proc (NoMethodError)
from -e:1
$ ruby -ve "p proc { |a| puts 1 }.clone"
ruby 1.8.2 (2004-07-29) [i686-linux]
#<Proc:0x402ba958@-e:1>
I'm just used to using #dup. Should I be using #clone instead? I guess
I've never taken the time to understand the semantic difference between
the two.
- Jamis
but Proc#clone works.
Is this expected behavior?
$ ruby -ve "p proc { |a| puts 1 }.dup"
ruby 1.8.2 (2004-07-29) [i686-linux]
-e:1:in `dup': allocator undefined for Proc (NoMethodError)
from -e:1
$ ruby -ve "p proc { |a| puts 1 }.clone"
ruby 1.8.2 (2004-07-29) [i686-linux]
#<Proc:0x402ba958@-e:1>
I'm just used to using #dup. Should I be using #clone instead? I guess
I've never taken the time to understand the semantic difference between
the two.
- Jamis