From: Austin Ziegler Date: 2005-11-17T10:26:56+09:00 Subject: Re: Proposed RCR: Object#replace On 11/16/05, Ara.T.Howard wrote: > On Thu, 17 Nov 2005, Austin Ziegler wrote: > > does. Yes, I think it should be that restrictive -- exact match only. This > > isn't #become, it's #replace. This isn't typecasting, it's replacing the > > internals of one object with those of another object OF THE EXACT SAME KIND. > > (Granted, singleton objects tend to confuse things, but this is closer to > > the behaviour of #dup than of #clone.) The behaviour for this is relatively > > well-established by the #replace implementations on the internal objects > > Array, Hash, and String. > i like the idea. why not make it more generic and have semantics for a > > class Object > def reinitialize other = self > ... > end > end > > paradigm/hook. a copy ctor sort of thing. It's not really a reinitialization. It's *almost* #become -- but not quite. As I said, look at Transaction::Simple for the use case that I have. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca