|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSymbol
Symbols are a basic datatype in Lisp. There should be only one Symbol with a given name accessible, so most applications should use intern() rather than creating Symbols using the constructor.
Field Summary | |
(package private) static int |
gencounter
Counter used by gensym(). |
(package private) java.lang.String |
name
The name of this symbol (what Lisp calls the ``print-name''). |
(package private) static java.util.HashMap |
symbolTable
Private static (class) field holding name->Symbol mapping. |
Constructor Summary | |
Symbol(java.lang.String name)
Create a new symbol with the given name. |
Method Summary | |
Unifiable |
copyWithBindings(BindingSet bindings)
Returns this Symbol itself, since applying bindings to a Symbol has no effect and symbols don't need to be copied. |
static Symbol |
gensym(java.lang.String name)
Return a new uniquely-named Symbol whose name starts with the given String. |
static Symbol |
gensym(Symbol other)
Return a new uniquely-named Symbol whose name starts with the name of the given Symbol. |
static Symbol |
intern(java.lang.String name)
Main method for getting a Symbol given a name; creates the Symbol if necessary. |
java.lang.String |
toString()
Returns the printable representation of this Symbol (i.e., its name). |
boolean |
unifyWith(Unifiable other,
BindingSet bindings)
Try to unify this Symbol with another Unifiable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
java.lang.String name
static java.util.HashMap symbolTable
static int gencounter
Constructor Detail |
public Symbol(java.lang.String name)
Method Detail |
public java.lang.String toString()
public static Symbol intern(java.lang.String name)
public static Symbol gensym(java.lang.String name)
public static Symbol gensym(Symbol other)
public boolean unifyWith(Unifiable other, BindingSet bindings)
unifyWith
in interface Unifiable
public Unifiable copyWithBindings(BindingSet bindings)
copyWithBindings
in interface Unifiable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |