| java.lang.Object jsint.Procedure
All known Subclasses: jsint.Reflector, jsint.Primitive, jsint.RawConstructor, jsint.Closure, jsint.RawMethod, jsint.Continuation,
Procedure | abstract public class Procedure implements Runnable,java.io.Serializable,jscheme.SchemeProcedure(Code) | | Abstract superclass of Procedures. Procedures of no arguments,
called "thunks", implement the Runnable interface.
To invoke a Procedure from Java, use apply(Pair).
author: Peter Norvig, Copyright 1998, peter@norvig.com, license author: subsequently modified by Jscheme project members author: licensed under zlib licence (see license.txt) |
Method Summary | |
abstract public Object | apply(Object[] args) Apply the procedure to an argument list, which is represented as a
parameter-oriented array. | public Object | apply(jscheme.SchemePair args) | public Object | apply(Pair args) Convert an argument list into an argument array, and call apply
on that. | public static Object | catching(Procedure E, Procedure F) Like tryCatch, but returns wrapped exception. | public String | getName() | public Object[] | makeArgArray(Object[] code, Evaluator eval, LexicalEnvironment lexenv) Take the code that represents a call, evaluate arguments in the calling
lexical environment and put results into an argument array. | public Object[] | makeArgArray(Pair args) Convert a list of arguments into an array expected by the procedure. | public int | nParms() How many parameters does this procedure have. | public void | run() | public Object | setName(Object name) If the procedure has not yet been named, name it. | public static Object | stripExceptionWrapper(Object e) | public static Object | synchronize(Object x, Procedure p) | public static Object | throwObject(Object e) | public static Object | throwRuntimeException(RuntimeException E) | public String | toString() | protected String | toStringArgs() | public static Object | tryCatch(Object E, Object F) | public static Object | tryFinally(Object e, Object f) Provide scheme access to finally - unwind-protect. |
maxArgs | public int maxArgs(Code) | | |
minArgs | public int minArgs(Code) | | |
Procedure | public Procedure()(Code) | | |
Procedure | public Procedure(int minArgs, int maxArgs)(Code) | | |
apply | abstract public Object apply(Object[] args)(Code) | | Apply the procedure to an argument list, which is represented as a
parameter-oriented array. That is, if the procedure p has the parameter
list (x y . z) and the call is (p 1 2 3 4) then
args will be the array {1, 2, (3 4)}. *
|
apply | public Object apply(Pair args)(Code) | | Convert an argument list into an argument array, and call apply
on that. *
|
makeArgArray | public Object[] makeArgArray(Object[] code, Evaluator eval, LexicalEnvironment lexenv)(Code) | | Take the code that represents a call, evaluate arguments in the calling
lexical environment and put results into an argument array. Note that
code[0] is the procedure, not an argument. For example,
(p 1 2 3 (+ 2 2)) turns into the code {p, 1, 2, 3, {+, 2, 2}},
and if p has the parameter list (x y . z) then
p.makeArgArray(code, lexenv) would return {1, 2, (3 4)}. *
|
makeArgArray | public Object[] makeArgArray(Pair args)(Code) | | Convert a list of arguments into an array expected by the procedure.
(See apply for an explanation of what is expected.) *
|
nParms | public int nParms()(Code) | | How many parameters does this procedure have. This is different than the
number of arguments it expects. For example, list expects any
number of arguments, but it has only one parameter. *
|
setName | public Object setName(Object name)(Code) | | If the procedure has not yet been named, name it.
The idea is if I do (define (id x) x) and then
(define default-proc id), then the procedure is called "id". *
|
tryCatch | public static Object tryCatch(Object E, Object F)(Code) | | provide scheme access to the "try/catch" expression of Java
|
tryFinally | public static Object tryFinally(Object e, Object f)(Code) | | Provide scheme access to finally - unwind-protect. *
|
|
|