|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jatha.dynatype.StandardLispValue org.jatha.dynatype.StandardLispConsOrNil
public abstract class StandardLispConsOrNil
An abstract class for the CONS and NIL data types.
LispValue
,
LispInteger
,
LispReal
Field Summary |
---|
Fields inherited from class org.jatha.dynatype.StandardLispValue |
---|
f_lisp |
Constructor Summary | |
---|---|
StandardLispConsOrNil()
|
|
StandardLispConsOrNil(Jatha lisp)
|
Method Summary | |
---|---|
boolean |
basic_consp()
Returns Java true if the object is a CONS cell. |
boolean |
basic_listp()
Returns Java true if the object is a CONS cell or NIL. |
LispValue |
butlast()
Returns all but the last of the elements of a list. |
LispValue |
elt(LispValue index)
Returns the nth element of a list. |
Iterator |
iterator()
Returns an iterator over the clauses of the path. |
LispValue |
length()
Returns the length of a list or string. |
LispValue |
listp()
Returns T if the object is a list. |
LispValue |
nconc(LispValue arg)
If this object is NIL, returns the argument. |
LispValue |
nreverse()
Destructively reverses the given list. |
LispValue |
pop()
Pops a list and returns the first element. |
LispValue |
position(LispValue element)
Returns the index of an element in a sequence. |
LispValue |
reverse()
Returns the reversed value of a list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StandardLispConsOrNil()
public StandardLispConsOrNil(Jatha lisp)
Method Detail |
---|
public boolean basic_consp()
LispValue
basic_consp
in interface LispValue
basic_consp
in class StandardLispValue
public boolean basic_listp()
LispValue
basic_listp
in interface LispValue
basic_listp
in class StandardLispValue
public LispValue butlast()
LispValue
butlast
in interface LispValue
butlast
in class StandardLispValue
public LispValue elt(LispValue index)
LispValue
elt
in interface LispValue
elt
in class StandardLispValue
public LispValue length()
LispValue
length
in interface LispValue
length
in class StandardLispValue
public LispValue listp()
LispValue
listp
in interface LispValue
listp
in class StandardLispValue
public LispValue nconc(LispValue arg)
nconc
in interface LispValue
nconc
in class StandardLispValue
public LispValue nreverse()
LispValue
nreverse
in interface LispValue
nreverse
in class StandardLispValue
public LispValue pop()
StandardLispValue
LispValue 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 LispValue
pop
in class StandardLispValue
public LispValue position(LispValue element)
position
in interface LispValue
position
in class StandardLispValue
public LispValue reverse()
LispValue
reverse
in interface LispValue
reverse
in class StandardLispValue
public Iterator iterator()
iterator
in interface LispValue
iterator
in class StandardLispValue
|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |