Brian Candler wrote:

> The overhead of a single copy is small, and in any case this is probably 
> what is needed here (e.g. if the user makes some edits but clicks 
> 'cancel' instead of 'save' then you may want to keep the old string 
> untouched)
> 
> You could try deferring the dup until the first time you call a 
> destructive method on the string, but the complexity overhead is 
> unlikely to be worth it.

Yes, I've got the set_buffer doing a dup (if its a string).

At the same time, the get_buffer also does a dup, since often the Field 
is created blank (i did mention that set_buffer is an optional method 
for editing a default value, if present).

Its a real TextField or Field. So you would be typing away in the field. 
Each character you type is inserted in (or removed if its del or BS) - 
exactly as I am typing away in this editbox.

The CopyOnWriteString a impressive, shows what all can be done with 
Ruby.
-- 
Posted via http://www.ruby-forum.com/.