Class: Keisan::Functions::Let
Instance Attribute Summary
#arity, #name
Instance Method Summary
collapse
#differentiate, #unbound_variables
Constructor Details
#initialize ⇒ Let
Returns a new instance of Let.
4
5
6
|
# File 'lib/keisan/functions/let.rb', line 4
def initialize
super("let", ::Range.new(1,2))
end
|
Instance Method Details
#evaluate(ast_function, context = nil) ⇒ Object
12
13
14
15
|
# File 'lib/keisan/functions/let.rb', line 12
def evaluate(ast_function, context = nil)
validate_arguments!(ast_function.children.count)
assignment(ast_function).evaluate(context)
end
|
#simplify(ast_function, context = nil) ⇒ Object
17
18
19
|
# File 'lib/keisan/functions/let.rb', line 17
def simplify(ast_function, context = nil)
evaluate(ast_function, context)
end
|
#value(ast_function, context = nil) ⇒ Object
8
9
10
|
# File 'lib/keisan/functions/let.rb', line 8
def value(ast_function, context = nil)
evaluate(ast_function, context)
end
|