Class: Array
Instance Method Summary collapse
-
#rest ⇒ Object
(also: #cdr)
Lisp-style list access.
- #to_list ⇒ Object (also: #to_sexp)
Instance Method Details
#rest ⇒ Object Also known as: cdr
Lisp-style list access
3 4 5 |
# File 'lib/array_extensions.rb', line 3 def rest self[1 .. -1] end |
#to_list ⇒ Object Also known as: to_sexp
10 11 12 13 14 15 16 |
# File 'lib/array_extensions.rb', line 10 def to_list if self.cdr.empty? BusScheme::Cons.new(self.car, nil) else BusScheme::Cons.new(self.car, self.cdr.to_list) end end |