Class: AjLisp::Primitive

Inherits:
Object
  • Object
show all
Defined in:
lib/ajlisp/primitive.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(context, list) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ajlisp/primitive.rb', line 5

def evaluate(context, list)
  args = []
  rest = list.rest
  
  while rest != nil
    args.push(AjLisp::evaluate(context, rest.first))
    rest = rest.rest
  end
  
  return apply(context, args)
end