Class: Campa::Lisp::LambdaFn

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

Instance Method Summary collapse

Constructor Details

#initializeLambdaFn

Returns a new instance of LambdaFn.



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

def initialize
  @printer = Printer.new
end

Instance Method Details

#call(params, *body, env:) ⇒ Object



12
13
14
15
16
17
# File 'lib/campa/lisp/lambda_fn.rb', line 12

def call(params, *body, env:)
  raise parameters_error(printer.call(params)) if !params.respond_to?(:find)

  validate_params(params)
  Lambda.new(params, body, env)
end

#macro?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/campa/lisp/lambda_fn.rb', line 8

def macro?
  true
end