From: William Morgan Date: 2005-07-08T02:44:54+09:00 Subject: Re: Inheriting Array and slice() behaviour Excerpts from Yukihiro Matsumoto's mail of 6 Jul 2005 (EDT): > |Like the OP, I think it's weird and special-cased to have #slice > |magically return something with the receiver's class. Especially since > |the return value is going to be broken (not initialized) except in > |trivial cases. > > What if it can be initialized properly? But I don't think it can be. To be initialized, #initialize must be called, but #initialize can have required arguments. That's the essence of my trouble with Array#slice: returned objects can't be initialized properly. I think the subclass should override #slice if they want this behavior, and then they can explicitly call #new with the correct arguments. They're probably going to have to do this for #+, anyways. But I guess I'm the lone gunman by now, so I will stop pressing the issue. Thanks for your comments! -- William