Gennady Bystritsky wrote:
> 2 points here (and sorry for the top posting -- my web mail client does 
> not quote properly):
> 
> 1. It may be the case that if an object is not dup()-able, you better 
> not quietly continue with an original object as modifying it may cause 
> undesired side effects. In this case, an exception from calling dup(), 
> either NoMethodError or TypeError (can't dup Fixnum),  is a valid reason 
> to report a datatype error.
> 
> 2. Instead of dup()-ing, you may consider using a proxy class that will 
> delegate to the original object, yet keeping track of all modifications. 
> It will work even for data types that do not support dup().
> 
> Best,
> Gennady.
> ________________________________________

Ouch! Your web client has exposed my email id to the spammers :-(
Anyway,.... no, here i do not want the original value touched since the 
user may press Escape and abandon editing.

In the case of numbers and floats, usually its a call by value so a copy 
is made anyway.

Anyway, as a newbie, it was quite a surprise - i've relied on 
respond_to? to take care of a lot of generic code.

thx.
-- 
Posted via http://www.ruby-forum.com/.