From: "Ara.T.Howard" Date: 2005-11-17T05:22:17+09:00 Subject: Re: Proposed RCR: Object#replace On Thu, 17 Nov 2005, Trans wrote: > > Ara.T.Howard wrote: > >> sure - dangerous though, resources can leak and not everything supports clone. >> >> i like it mind you. > > Though as David pointed out I don't think the cloning qualifies it for > #replace actually. I have a Facet method called #assign_from. Currently > it does no duplication, but you make me think that maybe it should. And > it can be made more robust to check for #clone, then #dup and if all > else fails maybe then go ahead and reference directly. > > But what resources could leak? take an open file handle, memory map, or database connection. you'll be relying on the gc to close it. that may or may not work in all cases. eg. loop{ HasFileHandle::new.replace HasFileHandle::new } not a show stopper - just something to consider. i don't really see what you could be expected to do about it - just throwing it out there... -a -- =============================================================================== | ara [dot] t [dot] howard [at] gmail [dot] com | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ===============================================================================