From: William Morgan Date: 2005-07-08T05:00:44+09:00 Subject: Re: Inheriting Array and slice() behaviour Excerpts from Ara.T.Howard's mail of 7 Jul 2005 (EDT): > On Fri, 8 Jul 2005, William Morgan wrote: > >My problem with Array#slice is that the objects created will never > >have #initialize called. Indeed, they never *can* have it called, > >because who knows what arguments need to be supplied. > > it's this simple: Actually, it's even simpler---the author of Expression can simply override #slice to do the right thing. The point is that the *author* must do this explicitly. If Ruby tries to do this automatically, it will return invalid objects. In short, the current #slice behavior is a) wrong in non-trivial cases, b) magic, and c) inconsistent with #+ and other methods. -- William