Class: Plasma::Interpreter::DefunNode
- Inherits:
-
PlasmaNode
- Object
- Treetop::Runtime::SyntaxNode
- PlasmaNode
- Plasma::Interpreter::DefunNode
- Defined in:
- lib/plasma/interpreter/plasma_grammarnode.rb
Instance Method Summary collapse
Methods inherited from PlasmaNode
Instance Method Details
#evaluate(env) ⇒ Object
244 245 246 247 248 249 250 |
# File 'lib/plasma/interpreter/plasma_grammarnode.rb', line 244 def evaluate(env) syms = params.syms closure = Closure.new(env, syms.slice(1..syms.length), plasma) closure.env.merge!(syms[0] => closure) env.bind!(syms[0], closure) '' end |