orc.runtime.values
Class Closure
java.lang.Object
orc.runtime.values.Value
orc.runtime.values.Closure
- All Implemented Interfaces:
- Callable
public class Closure
- extends Value
- implements Callable
Represents a standard closure: a function defined in an environment.
Note that a closure is not necessarily a resolved value, since it may contain unbound
variables, and therefore cannot be used in arg position until all such variables
become bound.
- Author:
- wcook, dkitchin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Closure
public Closure(int arity,
Node body,
Env env)
createCall
public void createCall(Token t,
java.util.List<java.lang.Object> args,
Node nextNode)
throws ArityMismatchException
- Description copied from interface:
Callable
- Create a call to a callable value
- Specified by:
createCall
in interface Callable
- Parameters:
t
- token for which the call is being made: points to the call nodeargs
- argument listnextNode
- next node after the call node, to which the result should be sent
- Throws:
ArityMismatchException
setEnvironment
public void setEnvironment(Env env)
accept
public <E> E accept(Visitor<E> visitor)
- Overrides:
accept
in class Value