Class: Campa::Lisp::Cons
- Inherits:
-
Object
- Object
- Campa::Lisp::Cons
- Defined in:
- lib/campa/lisp/cons.rb
Instance Method Summary collapse
- #call(new_head, list) ⇒ Object
-
#initialize ⇒ Cons
constructor
A new instance of Cons.
Constructor Details
Instance Method Details
#call(new_head, list) ⇒ Object
8 9 10 11 12 |
# File 'lib/campa/lisp/cons.rb', line 8 def call(new_head, list) raise illegal_argument(list) if !list.is_a?(List) list.push(new_head) end |