|
Jatha Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jatha.dynatype.StandardLispValue
org.jatha.dynatype.StandardLispAtom
org.jatha.dynatype.StandardLispSymbol
public class StandardLispSymbol
LispSymbol implements LISP Symbols, including provisions for special bindings.
LispValue,
LispAtom| Field Summary | |
|---|---|
protected Map |
f_documentation
|
protected LispValue |
f_function
|
protected boolean |
f_isExternalInPackage
|
protected boolean |
f_isSpecial
|
protected boolean |
f_mixedCase
|
protected LispString |
f_name
|
protected LispPackage |
f_package
|
protected LispValue |
f_plist
|
protected int |
f_specialCount
|
protected LispValue |
f_value
|
| Fields inherited from class org.jatha.dynatype.StandardLispValue |
|---|
f_lisp |
| Constructor Summary | |
|---|---|
StandardLispSymbol()
|
|
StandardLispSymbol(Jatha lisp,
LispString symbolNameString)
|
|
StandardLispSymbol(Jatha lisp,
String symbolName)
|
|
| Method Summary | |
|---|---|
void |
adjustSpecialCount(int amount)
|
LispValue |
apply(LispValue args)
Apply a function to an argument list. |
void |
apropos_print(PrintWriter out)
Prints information for the APROPOS function |
boolean |
basic_symbolp()
Returns Java true if the object is a symbol. |
LispValue |
boundp()
Returns T if the symbol has been assigned a value. |
LispValue |
documentation(LispValue type)
Returns the documentation string for this symbol, of the type specified. |
boolean |
equals(LispSymbol otherSymbol)
|
boolean |
externalP()
Returns true if the symbol is external in its package. |
LispValue |
fboundp()
Returns T if the symbol has an assigned function. |
LispValue |
funcall(LispValue args)
Calls a functio non a list of arguments. |
int |
get_specialCount()
|
String |
internal_getName()
Returns the Java String representing the symbol's name, without any quoting. |
void |
internal_prin1(PrintStream os)
|
void |
internal_princ(PrintStream os)
|
void |
internal_print(PrintStream os)
|
LispValue |
pop()
Pops a list and returns the first element. |
LispValue |
push(LispValue newValue)
Pushes an element onto a list and returns the list. |
void |
set_special(boolean value)
|
void |
setExternal(boolean value)
Sets whether the symbol is external in its package. |
LispValue |
setf_documentation(LispValue type,
LispValue value)
Sets the documentation string for this symbol of the type specified. |
LispValue |
setf_symbol_function(LispValue newCode)
Sets the function of a symbol. |
LispValue |
setf_symbol_plist(LispValue newPlist)
Sets the property list of a symbol. |
LispValue |
setf_symbol_value(LispValue newValue)
Sets the value of a symbol. |
void |
setPackage(LispPackage newPackage)
|
LispValue |
setq(LispValue newValue)
Assigns a value to a symbol. |
boolean |
specialP()
|
LispValue |
string()
Converts a String, Symbol or Character to a string. |
LispValue |
symbol_function()
Returns the function assigned to a symbol. |
LispValue |
symbol_name()
Returns a string containing the name of a symbol. |
LispValue |
symbol_package()
Returns the package of a symbol. |
LispValue |
symbol_plist()
Returns the property list of a symbol. |
LispValue |
symbol_value()
Returns the value of a symbol. |
LispValue |
symbolp()
Returns T if the object is a symbol. |
Object |
toJava()
Returns a Java String containing a printed representation of this symbol. |
String |
toString()
Returns this symbol as a string, including the package. |
String |
toStringSimple()
Strips or-bars from a LispSymbol name. |
LispValue |
type_of()
|
LispValue |
typep(LispValue type)
|
| Methods inherited from class org.jatha.dynatype.StandardLispAtom |
|---|
atom, basic_atom |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected LispValue f_function
protected LispString f_name
protected LispValue f_value
protected LispValue f_plist
protected LispPackage f_package
protected boolean f_isExternalInPackage
protected boolean f_isSpecial
protected int f_specialCount
protected boolean f_mixedCase
protected Map f_documentation
| Constructor Detail |
|---|
public StandardLispSymbol()
public StandardLispSymbol(Jatha lisp,
String symbolName)
public StandardLispSymbol(Jatha lisp,
LispString symbolNameString)
| Method Detail |
|---|
public boolean basic_symbolp()
LispValue
basic_symbolp in interface LispValuebasic_symbolp in class StandardLispValuepublic boolean equals(LispSymbol otherSymbol)
public String internal_getName()
internal_getName in interface LispValueinternal_getName in class StandardLispValuepublic void internal_prin1(PrintStream os)
internal_prin1 in interface LispValueinternal_prin1 in class StandardLispValuepublic void internal_princ(PrintStream os)
internal_princ in interface LispValueinternal_princ in class StandardLispValuepublic void internal_print(PrintStream os)
internal_print in interface LispValueinternal_print in class StandardLispValuepublic void apropos_print(PrintWriter out)
LispValue
apropos_print in interface LispValueapropos_print in class StandardLispValuepublic Object toJava()
toJava in interface LispValuetoJava in class StandardLispValuepublic String toString()
toString in interface LispValuetoString in class StandardLispValuepublic String toStringSimple()
toStringSimple in interface LispValuetoStringSimple in class StandardLispValuepublic void set_special(boolean value)
set_special in interface LispValueset_special in class StandardLispValuepublic boolean specialP()
specialP in interface LispValuespecialP in class StandardLispValuepublic void adjustSpecialCount(int amount)
adjustSpecialCount in interface LispValueadjustSpecialCount in class StandardLispValuepublic int get_specialCount()
get_specialCount in interface LispValueget_specialCount in class StandardLispValuepublic void setPackage(LispPackage newPackage)
setPackage in interface LispValuesetPackage in class StandardLispValuepublic void setExternal(boolean value)
LispSymbol
setExternal in interface LispSymbolpublic boolean externalP()
LispSymbol
externalP in interface LispSymbolpublic LispValue apply(LispValue args)
LispValue
apply in interface LispValueapply in class StandardLispValuepublic LispValue boundp()
LispValue
boundp in interface LispValueboundp in class StandardLispValuepublic LispValue fboundp()
LispValue
fboundp in interface LispValuefboundp in class StandardLispValuepublic LispValue funcall(LispValue args)
LispValue
funcall in interface LispValuefuncall in class StandardLispValuepublic LispValue pop()
StandardLispValueLispValue l1 = lisp.makeList(A, B); l1.pop(); // works correctly, l1 is now (B) l1.pop(); // doesn't work correctly. l1 is now (NIL . NIL)Jatha can't reassign l1 as expected.
However, the following does work:
LispValue l1 = new LispSymbol(lisp, "L1"); l1.setq(lisp.makeList(A, B)); l1.pop(); // works correctly. The value of L1 is now (B). l1.pop(); // works correctly. The value of L1 is now NIL. l1.push(A); // works correctly. The value of L1 is now (A). assert(l1.symbol_value().equal(lisp.makeList(A)) == lisp.T);
pop in interface LispValuepop in class StandardLispValuepublic LispValue push(LispValue newValue)
StandardLispValueLispValue l1 = LispValue.NIL; l1.push(A); // doesn't work correctly. l1 is still NIL. l1 = l1.push(A); // works correctly.Jatha can't reassign l1 as expected.
However, the following does work:
LispValue l1 = new LispSymbol("L1");
l1.setq(LispValue.NIL);
l1.push(B); // works correctly. The value of L1 is now (B).
l1.push(A); // works correctly. The value of L1 is now (A B).
assert(l1.symbol_value().equal(LispValueFactory.makeList(A, B)) == LispValue.T);
push in interface LispValuepush in class StandardLispValuepublic LispValue setf_symbol_function(LispValue newCode)
LispValue
setf_symbol_function in interface LispValuesetf_symbol_function in class StandardLispValuepublic LispValue setf_symbol_plist(LispValue newPlist)
LispValue
setf_symbol_plist in interface LispValuesetf_symbol_plist in class StandardLispValuepublic LispValue setf_symbol_value(LispValue newValue)
LispValue
setf_symbol_value in interface LispValuesetf_symbol_value in class StandardLispValuepublic LispValue setq(LispValue newValue)
LispValue
setq in interface LispValuesetq in class StandardLispValuepublic LispValue string()
string in interface LispValuestring in class StandardLispValuepublic LispValue symbolp()
LispValue
symbolp in interface LispValuesymbolp in class StandardLispValue
public LispValue symbol_function()
throws LispException
LispValue
symbol_function in interface LispValuesymbol_function in class StandardLispValueLispExceptionpublic LispValue symbol_name()
LispValue
symbol_name in interface LispValuesymbol_name in class StandardLispValuepublic LispValue symbol_package()
LispValue
symbol_package in interface LispValuesymbol_package in class StandardLispValuepublic LispValue symbol_plist()
LispValue
symbol_plist in interface LispValuesymbol_plist in class StandardLispValue
public LispValue symbol_value()
throws LispException
LispValue
symbol_value in interface LispValuesymbol_value in class StandardLispValueLispExceptionpublic LispValue type_of()
type_of in interface LispValuetype_of in class StandardLispValuepublic LispValue typep(LispValue type)
typep in interface LispValuetypep in class StandardLispAtompublic LispValue documentation(LispValue type)
LispValue
documentation in interface LispValuedocumentation in class StandardLispValuetype - a symbol
public LispValue setf_documentation(LispValue type,
LispValue value)
LispValue
setf_documentation in interface LispValuesetf_documentation in class StandardLispValuetype - a symbolvalue - a lispstring
|
Jatha Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||