Deep copy

J

Jim Freeze

Hi

I find that when I need to do a deep copy that I
usually just do the following:

x = Marshal.load(Marshal.dump(y)


Is there a more concise (possibly faster) method that
combines these two steps? If not, should we add one?
 
R

Robert Klemme

Jim Freeze said:
If I read the reports correctly, "Molly" the clone
had a ticking time bomb. (Maybe a thread with
a lifetime?)

Yeah, possibly. :)

robert
 
J

Jim Freeze

LOL

unless Jim.frozen?
Jim.post "comp.lang.ruby"
end

I'll have you know that the #freeze method is copyrighted by
myself. My lawyers inform me that every line of Ruby code written
that contains #freeze is subject to legal action or usage fees.
(You may want to use it sparingly in your code.)

However, #frozen is deemed an original work and is not legally
actionable.
 
R

Robert Klemme

Jim Freeze said:
I'll have you know that the #freeze method is copyrighted by
myself. My lawyers inform me that every line of Ruby code written
that contains #freeze is subject to legal action or usage fees.
(You may want to use it sparingly in your code.)

Ah, I've wondered why it is so seldomly used. Now that's clear (TM).
However, #frozen is deemed an original work and is not legally
actionable.

Ok, fine. Thank's for letting uns know.
"Never underestimate the power of a small tactical nuclear weapon."

Oops...

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top