From: David Alan Black Date: 2001-01-31T23:23:04+09:00 Subject: [ruby-talk:10169] Re: ArrayMixin 0.2 Hi -- On Wed, 31 Jan 2001, Mathieu Bouchard wrote: > > On Wed, 31 Jan 2001, David Alan Black wrote: > > On Wed, 31 Jan 2001, Mathieu Bouchard wrote: > > > Second "release" of ArrayMixin 0.2, a future equivalent to Perl's TIEARRAY > > > system. > > Can anyone help me out with an example or problem where Ruby (as it > > currently is) does not already allow us to do what we might do with > > Perl tie, with about the same amount of work? (Perl: define STORE, > > Ruby: (re)define #[]=, etc.) I seem to be absolutely unable to see > > it. > > In Perl you don't need to redefine the array slice. You don't need to > implement the complete semantics of what appears to be a store. When you > do: > > $blah[1] = 2 > > what is being done is really: > > tied(@blah)->STORE(1,2) > tied(@blah)->FETCH(1) [etc.] Thanks for your explanation and examples. They helped a lot. Looking forward to further news of ArrayMixin :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav