From: "David A. Black" Date: 2005-07-07T11:11:42+09:00 Subject: Re: Inheriting Array and slice() behaviour Hi -- On Thu, 7 Jul 2005, Sylvain Joyeux wrote: > This is a lisp-like language, so expressions are basically array of atoms > and expressions. When I do a slice() this is to get a subset of the list, > but a subset is not an expression itself. Expressions may be arrays or lists of atoms and expressions in a sense, but they're not actually instances of the Ruby class Array. > Expression is-a Array, but Expression.slice is just an Array That's true, by definition, if you decide up front that a slice operation has to return an Array object. I don't think I would, though. I'd actually tend to think of a "slice" of something as being "cut from the same cloth" (i.e., of the same class) as the original -- as opposed to, say, the results of a map operation, where you're transforming elements and then need a general-purpose container (an array) to store them in. David -- David A. Black dblack@wobblini.net