Package org.armedbear.lisp
Class LispObject
- java.lang.Object
-
- org.armedbear.lisp.LispObject
-
- Direct Known Subclasses:
AbstractArray,Complex,Cons,DoubleFloat,EMFCache,Environment,HashTable,JavaObject,Layout,LispCharacter,LispInteger,LispThread,Operator,Package,Pathname,RandomState,Ratio,Readtable,SingleFloat,StackFrame,StandardObject,StructureObject,Symbol,SymbolMacro,WeakHashTable,WeakReference
public class LispObject extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description LispObject()
-
Method Summary
-
-
-
Method Detail
-
resolve
public LispObject resolve()
Function to allow objects to return the value "they stand for". Used by AutoloadedFunctionProxy to return the function it is proxying.
-
typeOf
public LispObject typeOf()
-
getInstance
public static LispObject getInstance(boolean b)
-
classOf
public LispObject classOf()
-
getDescription
public LispObject getDescription()
-
getParts
public LispObject getParts()
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject. The protocol is to return a List of Cons pairs, where the car of each pair contains a decriptive string, and the cdr returns a subobject for inspection.
-
getBooleanValue
public boolean getBooleanValue()
-
typep
public LispObject typep(LispObject typeSpecifier)
-
constantp
public boolean constantp()
-
CONSTANTP
public final LispObject CONSTANTP()
-
ATOM
public final LispObject ATOM()
-
atom
public boolean atom()
-
javaInstance
public java.lang.Object javaInstance()
-
javaInstance
public java.lang.Object javaInstance(java.lang.Class<?> c)
-
lockableInstance
public java.lang.Object lockableInstance()
This method returns 'this' by default, but allows objects to return different values to increase Java interoperability- Returns:
- An object to be used with synchronized, wait, notify, etc
-
car
public final LispObject car()
-
setCar
public final void setCar(LispObject obj)
-
RPLACA
public LispObject RPLACA(LispObject obj)
-
cdr
public final LispObject cdr()
-
setCdr
public final void setCdr(LispObject obj)
-
RPLACD
public LispObject RPLACD(LispObject obj)
-
cadr
public final LispObject cadr()
-
cddr
public final LispObject cddr()
-
caddr
public final LispObject caddr()
-
nthcdr
public final LispObject nthcdr(int n)
-
push
public final LispObject push(LispObject obj)
-
EQ
public final LispObject EQ(LispObject obj)
-
eql
public boolean eql(char c)
-
eql
public boolean eql(int n)
-
eql
public boolean eql(LispObject obj)
-
EQL
public final LispObject EQL(LispObject obj)
-
EQUAL
public final LispObject EQUAL(LispObject obj)
-
equal
public boolean equal(int n)
-
equal
public boolean equal(LispObject obj)
-
equalp
public boolean equalp(int n)
-
equalp
public boolean equalp(LispObject obj)
-
ABS
public LispObject ABS()
-
NUMERATOR
public LispObject NUMERATOR()
-
DENOMINATOR
public LispObject DENOMINATOR()
-
EVENP
public final LispObject EVENP()
-
evenp
public boolean evenp()
-
ODDP
public final LispObject ODDP()
-
oddp
public boolean oddp()
-
PLUSP
public final LispObject PLUSP()
-
plusp
public boolean plusp()
-
MINUSP
public final LispObject MINUSP()
-
minusp
public boolean minusp()
-
NUMBERP
public final LispObject NUMBERP()
-
numberp
public boolean numberp()
-
ZEROP
public final LispObject ZEROP()
-
zerop
public boolean zerop()
-
COMPLEXP
public LispObject COMPLEXP()
-
FLOATP
public final LispObject FLOATP()
-
floatp
public boolean floatp()
-
INTEGERP
public final LispObject INTEGERP()
-
integerp
public boolean integerp()
-
RATIONALP
public final LispObject RATIONALP()
-
rationalp
public boolean rationalp()
-
REALP
public final LispObject REALP()
-
realp
public boolean realp()
-
STRINGP
public final LispObject STRINGP()
-
stringp
public boolean stringp()
-
SIMPLE_STRING_P
public LispObject SIMPLE_STRING_P()
-
VECTORP
public final LispObject VECTORP()
-
vectorp
public boolean vectorp()
-
CHARACTERP
public final LispObject CHARACTERP()
-
characterp
public boolean characterp()
-
length
public int length()
-
LENGTH
public final LispObject LENGTH()
-
CHAR
public LispObject CHAR(int index)
-
SCHAR
public LispObject SCHAR(int index)
-
NTH
public LispObject NTH(int index)
-
NTH
public final LispObject NTH(LispObject arg)
-
elt
public LispObject elt(int index)
-
reverse
public LispObject reverse()
-
nreverse
public LispObject nreverse()
-
aref_long
public long aref_long(int index)
-
aref
public int aref(int index)
-
AREF
public LispObject AREF(int index)
-
AREF
public final LispObject AREF(LispObject index)
-
aset
public void aset(int index, int n)
-
aset
public void aset(int index, LispObject newValue)
-
aset
public final void aset(LispObject index, LispObject newValue)
-
SVREF
public LispObject SVREF(int index)
-
svset
public void svset(int index, LispObject newValue)
-
vectorPushExtend
public void vectorPushExtend(LispObject element)
-
VECTOR_PUSH_EXTEND
public LispObject VECTOR_PUSH_EXTEND(LispObject element)
-
VECTOR_PUSH_EXTEND
public LispObject VECTOR_PUSH_EXTEND(LispObject element, LispObject extension)
-
noFillPointer
public final LispObject noFillPointer()
-
copyToArray
public LispObject[] copyToArray()
-
SYMBOLP
public final LispObject SYMBOLP()
-
listp
public final boolean listp()
-
LISTP
public final LispObject LISTP()
-
endp
public final boolean endp()
-
ENDP
public final LispObject ENDP()
-
NOT
public LispObject NOT()
-
isSpecialOperator
public boolean isSpecialOperator()
-
isSpecialVariable
public boolean isSpecialVariable()
-
getDocumentation
public LispObject getDocumentation(LispObject docType)
-
setDocumentation
public void setDocumentation(LispObject docType, LispObject documentation)
-
getPropertyList
public LispObject getPropertyList()
-
setPropertyList
public void setPropertyList(LispObject obj)
-
getSymbolValue
public LispObject getSymbolValue()
-
getSymbolFunction
public LispObject getSymbolFunction()
-
getSymbolFunctionOrDie
public LispObject getSymbolFunctionOrDie()
-
getSymbolSetfFunction
public LispObject getSymbolSetfFunction()
-
getSymbolSetfFunctionOrDie
public LispObject getSymbolSetfFunctionOrDie()
-
princToString
public java.lang.String princToString()
PRINC-TO-STRING function to be used with Java objects- Returns:
- A string in human-readable format, as per PRINC definition
-
printObject
public java.lang.String printObject()
-
unreadableString
public final java.lang.String unreadableString(java.lang.String s)
Calls unreadableString(String s, boolean identity) with a default identity value of 'true'. This function is a helper for printObject()- Parameters:
s- String representation of this object.- Returns:
- String enclosed in the non-readable #< ... > markers
-
unreadableString
public final java.lang.String unreadableString(java.lang.String s, boolean identity)Creates a non-readably (as per CLHS terminology) representation of the 'this' object, using string 's'. If the current value of the variable *PRINT-READABLY* is T, a Lisp error is thrown and no value is returned. This function is a helper for printObject()- Parameters:
s-identity- when 'true', includes Java's identityHash for the object in the output.- Returns:
- a non reabable string (i.e. one enclosed in the #< > markers)
-
execute
public LispObject execute(LispObject args, Environment env)
-
execute
public LispObject execute()
-
execute
public LispObject execute(LispObject arg)
-
execute
public LispObject execute(LispObject first, LispObject second)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh)
-
execute
public LispObject execute(LispObject first, LispObject second, LispObject third, LispObject fourth, LispObject fifth, LispObject sixth, LispObject seventh, LispObject eighth)
-
execute
public LispObject execute(LispObject[] args)
-
dispatch
public LispObject dispatch(LispObject[] args)
-
intValue
public int intValue()
-
longValue
public long longValue()
-
floatValue
public float floatValue()
-
doubleValue
public double doubleValue()
-
incr
public LispObject incr()
-
decr
public LispObject decr()
-
negate
public LispObject negate()
-
add
public LispObject add(int n)
-
add
public LispObject add(LispObject obj)
-
subtract
public LispObject subtract(int n)
-
subtract
public LispObject subtract(LispObject obj)
-
multiplyBy
public LispObject multiplyBy(int n)
-
multiplyBy
public LispObject multiplyBy(LispObject obj)
-
divideBy
public LispObject divideBy(LispObject obj)
-
isEqualTo
public boolean isEqualTo(int n)
-
isEqualTo
public boolean isEqualTo(LispObject obj)
-
IS_E
public final LispObject IS_E(LispObject obj)
-
isNotEqualTo
public boolean isNotEqualTo(int n)
-
isNotEqualTo
public boolean isNotEqualTo(LispObject obj)
-
IS_NE
public final LispObject IS_NE(LispObject obj)
-
isLessThan
public boolean isLessThan(int n)
-
isLessThan
public boolean isLessThan(LispObject obj)
-
IS_LT
public final LispObject IS_LT(LispObject obj)
-
isGreaterThan
public boolean isGreaterThan(int n)
-
isGreaterThan
public boolean isGreaterThan(LispObject obj)
-
IS_GT
public final LispObject IS_GT(LispObject obj)
-
isLessThanOrEqualTo
public boolean isLessThanOrEqualTo(int n)
-
isLessThanOrEqualTo
public boolean isLessThanOrEqualTo(LispObject obj)
-
IS_LE
public final LispObject IS_LE(LispObject obj)
-
isGreaterThanOrEqualTo
public boolean isGreaterThanOrEqualTo(int n)
-
isGreaterThanOrEqualTo
public boolean isGreaterThanOrEqualTo(LispObject obj)
-
IS_GE
public final LispObject IS_GE(LispObject obj)
-
truncate
public LispObject truncate(LispObject obj)
-
MOD
public LispObject MOD(LispObject divisor)
-
MOD
public LispObject MOD(int divisor)
-
ash
public LispObject ash(int shift)
-
ash
public LispObject ash(LispObject obj)
-
LOGNOT
public LispObject LOGNOT()
-
LOGAND
public LispObject LOGAND(int n)
-
LOGAND
public LispObject LOGAND(LispObject obj)
-
LOGIOR
public LispObject LOGIOR(int n)
-
LOGIOR
public LispObject LOGIOR(LispObject obj)
-
LOGXOR
public LispObject LOGXOR(int n)
-
LOGXOR
public LispObject LOGXOR(LispObject obj)
-
LDB
public LispObject LDB(int size, int position)
-
sxhash
public int sxhash()
-
psxhash
public int psxhash()
-
psxhash
public int psxhash(int depth)
-
STRING
public LispObject STRING()
-
chars
public char[] chars()
-
getStringChars
public char[] getStringChars()
-
getStringValue
public java.lang.String getStringValue()
Returns a string representing the value of a 'string designator', if the instance is one. Throws an error if the instance isn't a string designator.
-
getSlotValue_0
public LispObject getSlotValue_0()
-
getSlotValue_1
public LispObject getSlotValue_1()
-
getSlotValue_2
public LispObject getSlotValue_2()
-
getSlotValue_3
public LispObject getSlotValue_3()
-
getSlotValue
public LispObject getSlotValue(int index)
-
getFixnumSlotValue
public int getFixnumSlotValue(int index)
-
getSlotValueAsBoolean
public boolean getSlotValueAsBoolean(int index)
-
setSlotValue_0
public void setSlotValue_0(LispObject value)
-
setSlotValue_1
public void setSlotValue_1(LispObject value)
-
setSlotValue_2
public void setSlotValue_2(LispObject value)
-
setSlotValue_3
public void setSlotValue_3(LispObject value)
-
setSlotValue
public void setSlotValue(int index, LispObject value)
-
SLOT_VALUE
public LispObject SLOT_VALUE(LispObject slotName)
-
setSlotValue
public void setSlotValue(LispObject slotName, LispObject newValue)
-
getCallCount
public int getCallCount()
-
setCallCount
public void setCallCount(int n)
-
incrementCallCount
public void incrementCallCount()
-
getHotCount
public int getHotCount()
-
setHotCount
public void setHotCount(int n)
-
incrementHotCount
public void incrementHotCount()
-
-