ix.util.lisp
Class LList

java.lang.Object
  |
  +--ix.util.lisp.LispObject
        |
        +--ix.util.lisp.LList
Direct Known Subclasses:
Cons, Null

public abstract class LList
extends LispObject

Lisp-style lists.

The class structure is like that in Common Lisp -- there is an abstract class List with two subclasses, Cons and Null -- but only proper lists are allowed. The car of a Cons can be any Object, but the cdr must be a List.

The empty list is the value of Lisp.NIL and is the only instance of the class Null.

An important goal was that all lists, including the empty list, could be enumerated. That's one reason for having a List subclass for the empty list, rather than just using a unique Object or null. The subclass also allows a number of other methods to be defined for all lists.

See Also:
Lisp, Cons, Null

Constructor Summary
LList()
           
 
Method Summary
abstract  LList append(LList tail)
           
abstract  java.lang.Object car()
           
abstract  LList cdr()
           
 java.lang.Object clone()
           
 LList drop(int n)
           
abstract  java.lang.Object elementAt(int i)
           
abstract  java.util.Enumeration elements()
           
abstract  boolean equal(LList list)
           
abstract  boolean find(java.lang.Object a)
           
 LList flatmap(Function1 f)
           
 java.lang.Object get(java.lang.Object propname)
           
 LList intersect(LList set)
           
abstract  boolean isNull()
           
 Cons lastCons()
           
abstract  int length()
           
 LList mapc(Function1 f)
           
 LList mapcar(Function1 f)
           
 LList permute()
           
 LList replaceAll(java.lang.Object old, java.lang.Object neu)
           
 LList reverse()
           
 LList take(int n)
           
 void walkTree(Function1 f)
           
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

LList

public LList()
Method Detail

isNull

public abstract boolean isNull()

car

public abstract java.lang.Object car()

cdr

public abstract LList cdr()

length

public abstract int length()

elementAt

public abstract java.lang.Object elementAt(int i)

elements

public abstract java.util.Enumeration elements()

equal

public abstract boolean equal(LList list)

find

public abstract boolean find(java.lang.Object a)

append

public abstract LList append(LList tail)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

reverse

public LList reverse()

get

public java.lang.Object get(java.lang.Object propname)

lastCons

public Cons lastCons()

take

public LList take(int n)

drop

public LList drop(int n)

replaceAll

public LList replaceAll(java.lang.Object old,
                        java.lang.Object neu)

mapc

public LList mapc(Function1 f)

mapcar

public LList mapcar(Function1 f)

flatmap

public LList flatmap(Function1 f)

walkTree

public void walkTree(Function1 f)

intersect

public LList intersect(LList set)

permute

public LList permute()