From: "David A. Black" <dblack / rubypal.com>
>
> It's a question of the accuracy of the method name. If dup doesn't
> actually mean "duplicate this object", then it's a bad name for the
> method.

Interesting.  So it would appear that for you (and ruby,
currently) the meaning of "duplicate this object" is
inextricably bound to the changing of its object_id.

Whereas for me the meaning of "duplicate this object" is
more tied to its semantics in the context of mutability.

That is, object_id aside, if an object is an immutable
singleton, then a "duplicate" is semantically
indistinguishable from the original.  So...

Ignoring object_id, in what meaningful way are these
two nil objects,

>> [nil] * 2
=> [nil, nil]

...or these two :foo objects,

>> [:foo] * 2
=> [:foo, :foo]

...not effectively duplicates?


Is #dup useful strictly because object_id changes, or
is #dup useful because it returns an object which
satisfies "shallow copy semantics" with regard to the
original?

I tend to take the latter view, but I wonder... is 
anyone out there writing code that does depend on
object_id changing after a dup?


Regards,

Bill