|
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.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 LispValuebasic_consp in class StandardLispValuepublic boolean basic_listp()
LispValue
basic_listp in interface LispValuebasic_listp in class StandardLispValuepublic LispValue butlast()
LispValue
butlast in interface LispValuebutlast in class StandardLispValuepublic LispValue elt(LispValue index)
LispValue
elt in interface LispValueelt in class StandardLispValuepublic LispValue length()
LispValue
length in interface LispValuelength in class StandardLispValuepublic LispValue listp()
LispValue
listp in interface LispValuelistp in class StandardLispValuepublic LispValue nconc(LispValue arg)
nconc in interface LispValuenconc in class StandardLispValuepublic LispValue nreverse()
LispValue
nreverse in interface LispValuenreverse 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 position(LispValue element)
position in interface LispValueposition in class StandardLispValuepublic LispValue reverse()
LispValue
reverse in interface LispValuereverse in class StandardLispValuepublic Iterator iterator()
iterator in interface LispValueiterator in class StandardLispValue
|
Jatha Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||