public class Closure extends Function
Modifier and Type | Class and Description |
---|---|
static class |
Closure.Parameter |
Function.pf_function_class_bytes
Modifier and Type | Field and Description |
---|---|
private boolean |
allowOtherKeys |
private boolean |
andKey |
private int |
arity |
static int |
AUX |
private Closure.Parameter[] |
auxVars |
private boolean |
bindInitForms |
private LispObject |
body |
private Environment |
environment |
private Symbol |
envVar |
private LispObject |
executionBody |
static int |
KEYWORD |
private Closure.Parameter[] |
keywordParameters |
private static Primitive |
LAMBDA_LIST_NAMES |
private int |
maxArgs |
private int |
minArgs |
static int |
OPTIONAL |
private Closure.Parameter[] |
optionalParameters |
static int |
REQUIRED |
private Closure.Parameter[] |
requiredParameters |
static int |
REST |
private Symbol |
restVar |
private LispObject |
specials |
private static int |
STATE_AUX |
private static int |
STATE_KEYWORD |
private static int |
STATE_OPTIONAL |
private static int |
STATE_REQUIRED |
private static int |
STATE_REST |
private Symbol[] |
variables |
FUNCTION_CLASS_BYTES
lambdaName
Constructor and Description |
---|
Closure(Closure.Parameter[] required,
Closure.Parameter[] optional,
Closure.Parameter[] keyword,
Symbol keys,
Symbol rest,
Symbol moreKeys)
Construct a closure object with a lambda-list described
by these parameters.
|
Closure(LispObject lambdaExpression,
Environment env) |
Closure(LispObject name,
LispObject lambdaExpression,
Environment env) |
argCountError, classOf, getCallCount, getClassBytes, getHotCount, getPropertyList, incrementCallCount, incrementHotCount, setCallCount, setClassBytes, setHotCount, setPropertyList, typeOf, writeToString
getLambdaList, getLambdaName, getParts, setLambdaList, setLambdaName
ABS, add, add, aref_long, aref, AREF, AREF, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, equal, EQUAL, equalp, equalp, evenp, EVENP, execute, floatp, FLOATP, floatValue, getBooleanValue, getDescription, getDocumentation, getFixnumSlotValue, getInstance, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValue, getSlotValueAsBoolean, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, javaInstance, javaInstance, LDB, length, LENGTH, listp, LISTP, lockableInstance, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, psxhash, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCar, setCdr, setDocumentation, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, setSlotValue, setSlotValue, SIMPLE_STRING_P, SLOT_VALUE, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, sxhash, SYMBOLP, truncate, unreadableString, unreadableString, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
public static final int REQUIRED
public static final int OPTIONAL
public static final int KEYWORD
public static final int REST
public static final int AUX
private static final int STATE_REQUIRED
private static final int STATE_OPTIONAL
private static final int STATE_KEYWORD
private static final int STATE_REST
private static final int STATE_AUX
private Closure.Parameter[] requiredParameters
private Closure.Parameter[] optionalParameters
private Closure.Parameter[] keywordParameters
private Closure.Parameter[] auxVars
private final LispObject body
private final LispObject executionBody
private final Environment environment
private final boolean andKey
private final boolean allowOtherKeys
private Symbol restVar
private Symbol envVar
private int arity
private int minArgs
private int maxArgs
private Symbol[] variables
private LispObject specials
private boolean bindInitForms
private static final Primitive LAMBDA_LIST_NAMES
public Closure(Closure.Parameter[] required, Closure.Parameter[] optional, Closure.Parameter[] keyword, Symbol keys, Symbol rest, Symbol moreKeys)
required
- Required parameters or an empty array for noneoptional
- Optional parameters or an empty array for nonekeyword
- Keyword parameters or an empty array for nonekeys
- NIL if the lambda-list doesn't contain &key, T otherwiserest
- the &rest parameter, or NIL if nonemoreKeys
- NIL if &allow-other-keys not present, T otherwisepublic Closure(LispObject lambdaExpression, Environment env)
public Closure(LispObject name, LispObject lambdaExpression, Environment env)
private final void processParameters(ArrayList<Symbol> vars, Closure.Parameter[] parameters)
private final Symbol[] processVariables()
private static final void invalidParameter(LispObject obj)
public LispObject typep(LispObject typeSpecifier)
public final LispObject getVariableList()
public final LispObject getBody()
public final Environment getEnvironment()
public LispObject execute()
private final LispObject bindParametersAndExecute(LispObject... objects)
private final void bindRequiredParameters(Environment ext, LispThread thread, LispObject[] objects)
public final LispObject invokeArrayExecute(LispObject... objects)
public LispObject execute(LispObject arg)
public LispObject execute(LispObject first, LispObject second)
public LispObject execute(LispObject first, LispObject second, LispObject third)
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth)
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth)
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth)
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh)
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh, LispObject eighth)
private final void declareFreeSpecials(Environment ext)
public LispObject execute(LispObject[] args)
protected final LispObject[] processArgs(LispObject[] args, LispThread thread)
protected final LispObject[] fastProcessArgs(LispObject[] args)
private final void bindParameterDefaults(Closure.Parameter[] parameters, Environment env, LispThread thread)
private final void bindAuxVars(Environment env, LispThread thread)