| java.lang.Object jsint.Procedure jsint.Closure
All known Subclasses: jsint.Macro,
Closure | public class Closure extends Procedure implements Cloneable(Code) | | A closure is a user-defined procedure. It is "closed" over the
environment in which it was created. To apply the procedure, bind
the parameters to the passed in variables, and evaluate the body.
author: Peter Norvig, Copyright 2000, peter@norvig.com, license author: subsequently modified by Jscheme project members author: licensed under zlib licence (see license.txt) |
Closure | public Closure(Object parms, Object body, LexicalEnvironment lexenv)(Code) | | Make a closure from a body and the analyze time environment it
was defined in. To create a closure at execute time, use .copy()
|
apply | public Object apply(Object[] args)(Code) | | Apply a closure to a vector of arguments. Do this by creating a
new LexicalEnvironment containing the arguments, and then
evaluating the body of the closure in that new frame.
|
|
|