R
Robert Klemme
class Foo;end
=> nilja
=> nilja
=> nil
Here's a technical description:
"While clone is used to duplicate an object, including its internal state,
dup typically uses the class of the descendent object to create the new
instance."
http://www.ruby-doc.org/docs/rdoc/1.9/classes/Object.html#M000889
I'm interested in the reasoning behind this.
Kind regards
robert
=> nilja
=> nilja
=> nil
Here's a technical description:
"While clone is used to duplicate an object, including its internal state,
dup typically uses the class of the descendent object to create the new
instance."
http://www.ruby-doc.org/docs/rdoc/1.9/classes/Object.html#M000889
I'm interested in the reasoning behind this.
Kind regards
robert