orc.runtime.values
Class Value

java.lang.Object
  extended by orc.runtime.values.Value
All Implemented Interfaces:
Future
Direct Known Subclasses:
Closure, Constant, Field, ListValue, OptionValue, Site

public abstract class Value
extends java.lang.Object
implements Future

A fully evaluated Orc value. This includes sites, tuples of fully evaluated values, and native Java values. However, it does not include unbound or partially-bound values, which are instead in the broader category of Futures.

Author:
dkitchin

Constructor Summary
Value()
           
 
Method Summary
abstract
<E> E
accept(Visitor<E> visitor)
           
 Value forceArg(Token t)
           
 Callable forceCall(Token t)
           
 Value head()
          Return the head value of a cons-like data structure.
 boolean isCons()
           
 boolean isNil()
           
 boolean isNone()
           
 boolean isSome()
          Test whether this value inhabits one of the option or list types.
static Value signal()
          Static function to access the canonical 'signal' value Currently, the signal value is an empty tuple
 Value tail()
          Return the tail value of a cons-like data structure.
 Value untag()
          Return the contained value v of an option some(v).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Value

public Value()
Method Detail

forceArg

public Value forceArg(Token t)
Specified by:
forceArg in interface Future

forceCall

public Callable forceCall(Token t)
Specified by:
forceCall in interface Future

signal

public static Value signal()
Static function to access the canonical 'signal' value Currently, the signal value is an empty tuple


isSome

public boolean isSome()
Test whether this value inhabits one of the option or list types.


isNone

public boolean isNone()

isCons

public boolean isCons()

isNil

public boolean isNil()

untag

public Value untag()
Return the contained value v of an option some(v). This method must throw an exception iff isSome() returns false.


head

public Value head()
Return the head value of a cons-like data structure. This method must throw an exception iff isCons() returns false.


tail

public Value tail()
Return the tail value of a cons-like data structure. This method must throw an exception iff isCons() returns false.


accept

public abstract <E> E accept(Visitor<E> visitor)