orc.runtime.values
Class ListValue

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.values.ListValue
All Implemented Interfaces:
java.lang.Iterable, Eq, ListLike
Direct Known Subclasses:
ConsValue, NilValue

public abstract class ListValue
extends Value
implements java.lang.Iterable, ListLike, Eq

Common ancestor for ConsValue and NilValue. Unlike scheme, the Cons constructor does not allow you to create a degenerate cons where the tail is not a list, so we can guarantee that all Conses actually have a list structure. (If you want a degenerate cons, just use a tuples.)


Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
ListValue()
           
 
Method Summary
<E> E
accept(Visitor<E> visitor)
           
abstract  java.util.List<java.lang.Object> enlist()
           
 java.util.Iterator iterator()
           
static ListValue make(java.util.List<java.lang.Object> vs)
           
static ListValue make(java.lang.Object[] vs)
           
abstract  void uncons(Token caller)
          Return the head and tail of a cons-like data structure to a token, or die.
abstract  void unnil(Token caller)
          Signal a token if this value is equivalent to nil, or die.
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, signal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface orc.runtime.values.Eq
eqTo
 

Constructor Detail

ListValue

public ListValue()
Method Detail

enlist

public abstract java.util.List<java.lang.Object> enlist()

make

public static ListValue make(java.lang.Object[] vs)

make

public static ListValue make(java.util.List<java.lang.Object> vs)

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable

accept

public <E> E accept(Visitor<E> visitor)
Overrides:
accept in class Value

uncons

public abstract void uncons(Token caller)
Description copied from interface: ListLike
Return the head and tail of a cons-like data structure to a token, or die. The only place this should be called is TryCons

Specified by:
uncons in interface ListLike

unnil

public abstract void unnil(Token caller)
Description copied from interface: ListLike
Signal a token if this value is equivalent to nil, or die. The only place this should be called is TryNil

Specified by:
unnil in interface ListLike