From: William Morgan Date: 2005-07-08T07:10:54+09:00 Subject: Re: Inheriting Array and slice() behaviour Excerpts from Pit Capitain's mail of 7 Jul 2005 (EDT): > The LSP has been mentioned before in this thread. According to that > principle, if someone creates a subclass of Array, you should be able > to use the subclass like the original Array class. Array has a well > defined #initialize method that can take zero arguments. So should the > subclass, otherwise you're breaking the LSP. In other words, it's > perfectly legal to call self.class.new in #slice. If Expression can't > provide an #initialize method without arguments, it shouldn't be a > subclass of Array. So you're suggesting that #initialize be called (automatically) by Array#slice, with no arguments? And, presumably, an ArgumentError raised if it has required arguments? What about #+, #reverse, #select, etc.? -- William