From: Alex Polite Date: 2006-05-25T14:04:08+09:00 Subject: Re: Marshaling NArray objects. On 5/25/06, Joel VanderWerf wrote: > def marshal_load(ary) > p ary > @x, @y = ary # <-- populate self with persisted data > end > > Is there a NArray method like Array#replace ? That would probably do the > trick, if you called it in marshal_load with the narray as its argument. > There doesn't seem to be anything like replace in narray. Maybe I should resort to using a wrapper class around my narrays? class NArrayWrapper def initialize(narray) @narray = narray end def marshal_dump @narray.to_a end def marshal_load(array) @narray = NArray.to_narray(array) end end But then I'd have to write a whole bunch of accessor methods and stuff. I bet there's some C/ruby/narray wizardry that will replicate replace. alex -- Alex Polite http://flosspick.org - finding the right open source