The abstract parent for all Scheme functions.
apply
public void apply(CallContext ctx)
throws Throwable
Call this Procedure using the explicit-CallContext-convention.
The input arguments are (by default) in stack.args;
the result is written to ctx.consumer.
apply0
public abstract Object apply0()
throws Throwable
apply1
public abstract Object apply1(Object arg1)
throws Throwable
apply2
public abstract Object apply2(Object arg1,
Object arg2)
throws Throwable
apply3
public abstract Object apply3(Object arg1,
Object arg2,
Object arg3)
throws Throwable
apply4
public abstract Object apply4(Object arg1,
Object arg2,
Object arg3,
Object arg4)
throws Throwable
applyN
public abstract Object applyN(Object[] args)
throws Throwable
check0
public void check0(CallContext ctx)
Does match0, plus throws exception on argument mismatch.
check1
public void check1(Object arg1,
CallContext ctx)
Does match1, plus throws exception on argument mismatch.
check2
public void check2(Object arg1,
Object arg2,
CallContext ctx)
Does match, plus throws exception on argument mismatch.
check3
public void check3(Object arg1,
Object arg2,
Object arg3,
CallContext ctx)
Does match3, plus throws exception on argument mismatch.
check4
public void check4(Object arg1,
Object arg2,
Object arg3,
Object arg4,
CallContext ctx)
Does match4, plus throws exception on argument mismatch.
checkArgCount
public static void checkArgCount(Procedure proc,
int argCount)
Check that the number of arguments in a call is valid.
proc
- the Procedure being calledargCount
- the number of arguments in the call
checkN
public void checkN(Object[] args,
CallContext ctx)
Does matchN, plus throws exception on argument mismatch.
getProperty
public Object getProperty(Object key,
Object defaultValue)
match0
public int match0(CallContext ctx)
Pass zero arguments.
- non-negative if the match succeeded, else negative.
match1
public int match1(Object arg1,
CallContext ctx)
Pass one argument.
- non-negative if the match succeeded, else negative.
match2
public int match2(Object arg1,
Object arg2,
CallContext ctx)
Pass two arguments.
- non-negative if the match succeeded, else negative.
match3
public int match3(Object arg1,
Object arg2,
Object arg3,
CallContext ctx)
Pass three arguments.
- non-negative if the match succeeded, else negative.
match4
public int match4(Object arg1,
Object arg2,
Object arg3,
Object arg4,
CallContext ctx)
Pass four arguments.
- non-negative if the match succeeded, else negative.
matchN
public int matchN(Object[] args,
CallContext ctx)
maxArgs
public final int maxArgs()
Maximum number of arguments allowed, or -1 for unlimited.
(May also return -1 if there are keyword arguments, for implementation
reasons.)
minArgs
public final int minArgs()
Minimum number of arguments required.
name
public final String name()
numArgs
public int numArgs()
Return minArgs()|(maxArgs<<12).
removeProperty
public Object removeProperty(Object key)
set0
public void set0(Object result)
throws Throwable
If HasSetter, the Procedure is called in the LHS of an assignment.
set1
public void set1(Object arg1,
Object value)
throws Throwable
setN
public void setN(Object[] args)
throws Throwable
setName
public final void setName(String name)
- setName in interface Named
setProperty
public void setProperty(Object key,
Object value)
setProperty
public static Object[] setProperty(Object[] properties,
Object key,
Object value)
Given a property list, update it.
properties
- the input property listkey
- value
- associate this with key in result
- updated property list (maybe the same as the input)
setSetter
public void setSetter(Procedure setter)
setSymbol
public final void setSymbol(Object name)
toString
public String toString()