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. > > Expression is-a Array, but Expression.slice is just an Array > > Sylvain harp:~ > cat a.rb class Expression < ::Array munged_return_methods = %w( slice ) munged_return_methods.each{|m| eval "def #{ m }(*a, &b); Array[*super] ;end"} end exp = Expression['a', 'b', 'c'] p(exp.slice(0,2).class) harp:~ > ruby a.rb Array -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================