Johan Dahl wrote:
> ...
> 
> class Array
>         def head
>                 return self[0]
>         end
> 
>         def tail
>                 return self[1..self.length]
>         end
> end
> 

And I would use

class Array
  def head
    self[0]
  end
  
  def tail
    self[1..-1]
  end
end

for an even shorter but equivalent version of that.


Guy N. Hurst

-- 
HurstLinks Web Development    http://www.hurstlinks.com/
Norfolk, VA  23510            (757)623-9688 FAX 623-0433
PHP/MySQL - Ruby/Perl - HTML/Javascript