Class: Campa::Lisp::Cdr

Inherits:
Object
  • Object
show all
Defined in:
lib/campa/lisp/cdr.rb

Instance Method Summary collapse

Constructor Details

#initializeCdr

Returns a new instance of Cdr.



4
5
6
# File 'lib/campa/lisp/cdr.rb', line 4

def initialize
  @printer = Printer.new
end

Instance Method Details

#call(list) ⇒ Object



8
9
10
11
12
13
# File 'lib/campa/lisp/cdr.rb', line 8

def call(list)
  return nil if list.nil? || list == List::EMPTY
  raise illegal_argument(list) if !list.is_a?(List)

  list.tail
end