Class: Campa::Lisp::Cadr
- Inherits:
-
Object
- Object
- Campa::Lisp::Cadr
- Defined in:
- lib/campa/lisp/cadr.rb
Instance Method Summary collapse
- #call(operation, list) ⇒ Object
-
#initialize ⇒ Cadr
constructor
A new instance of Cadr.
- #macro? ⇒ Boolean
Constructor Details
Instance Method Details
#call(operation, list) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/campa/lisp/cadr.rb', line 14 def call(operation, list) return nil if list.nil? || list == List::EMPTY raise illegal_argument(list) if !list.is_a?(List) cut_list( list, operation .label[1..-2] .reverse .split("") ) end |
#macro? ⇒ Boolean
10 11 12 |
# File 'lib/campa/lisp/cadr.rb', line 10 def macro? true end |