org.fun4j.compiler
Class RunTime

java.lang.Object
  extended by org.fun4j.compiler.RunTime

public class RunTime
extends java.lang.Object

The Runtime environment. providing global maps and some static helper methods.

Author:
Thomas Mahler

Constructor Summary
RunTime()
           
 
Method Summary
static java.lang.Object compile(java.lang.Object obj)
           
static void define(java.lang.String key, java.lang.Object term)
           
static java.lang.Object dump()
           
static java.lang.Boolean eq(java.lang.Object x, java.lang.Object y)
           
static java.lang.Object eval(java.lang.Object obj)
           
static java.lang.Object explode(java.lang.Object x)
           
static java.lang.Object fasl()
           
static java.lang.Object getConstant(int id)
           
static java.lang.String getTempDir()
           
static java.lang.Object implode(java.lang.Object x)
           
static Function instantiateJavaFunction(java.lang.String classname)
           
static java.lang.Object invokeDynamic(java.lang.Object instance, java.lang.Object method, java.lang.Object argsAsCons)
           
static java.lang.Boolean isAtom(java.lang.Object obj)
           
static java.lang.Boolean isCompiled(java.lang.Object obj)
           
static java.lang.Boolean isList(java.lang.Object obj)
           
static java.lang.Boolean isNumber(java.lang.Object obj)
           
static java.lang.Boolean isSymbol(java.lang.Object obj)
           
static java.lang.Object load(java.lang.Object x)
           
static java.lang.Object lookup(java.lang.String key)
           
static java.lang.Object prin(java.lang.Object x)
           
static java.lang.Object print(java.lang.Object x)
           
static java.lang.Object read(java.lang.Object ignored)
           
static int registerConstant(java.lang.Object obj)
           
static void resetEnv()
           
static void setTempDir(java.lang.String dir)
           
static void setupEnv()
          initialize the lisp environment.
static java.lang.Object thread(java.lang.Object obj)
           
static void undefine(java.lang.String key)
           
static void unregisterConstant(int id)
           
static void wakeup()
          this dummy method simply triggers loading of the class and thus execution of the static initializer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunTime

public RunTime()
Method Detail

setupEnv

public static void setupEnv()
initialize the lisp environment. load all predefined functions and load the init.lsp. all definition are stored in the RunTime globals and are thus available in any lisp code executed.


resetEnv

public static void resetEnv()

setTempDir

public static void setTempDir(java.lang.String dir)

getTempDir

public static java.lang.String getTempDir()

wakeup

public static void wakeup()
this dummy method simply triggers loading of the class and thus execution of the static initializer.


lookup

public static java.lang.Object lookup(java.lang.String key)

define

public static void define(java.lang.String key,
                          java.lang.Object term)

undefine

public static void undefine(java.lang.String key)

dump

public static java.lang.Object dump()
                             throws java.io.IOException
Throws:
java.io.IOException

fasl

public static java.lang.Object fasl()
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

registerConstant

public static int registerConstant(java.lang.Object obj)

getConstant

public static java.lang.Object getConstant(int id)

unregisterConstant

public static void unregisterConstant(int id)

isSymbol

public static java.lang.Boolean isSymbol(java.lang.Object obj)

isNumber

public static java.lang.Boolean isNumber(java.lang.Object obj)

isAtom

public static java.lang.Boolean isAtom(java.lang.Object obj)

isList

public static java.lang.Boolean isList(java.lang.Object obj)

isCompiled

public static java.lang.Boolean isCompiled(java.lang.Object obj)

thread

public static java.lang.Object thread(java.lang.Object obj)
                               throws CompilationException
Throws:
CompilationException

compile

public static java.lang.Object compile(java.lang.Object obj)
                                throws CompilationException
Throws:
CompilationException

eval

public static java.lang.Object eval(java.lang.Object obj)
                             throws CompilationException
Throws:
CompilationException

eq

public static java.lang.Boolean eq(java.lang.Object x,
                                   java.lang.Object y)

load

public static java.lang.Object load(java.lang.Object x)

print

public static java.lang.Object print(java.lang.Object x)

prin

public static java.lang.Object prin(java.lang.Object x)

explode

public static java.lang.Object explode(java.lang.Object x)

implode

public static java.lang.Object implode(java.lang.Object x)

read

public static java.lang.Object read(java.lang.Object ignored)
                             throws java.io.IOException
Throws:
java.io.IOException

invokeDynamic

public static java.lang.Object invokeDynamic(java.lang.Object instance,
                                             java.lang.Object method,
                                             java.lang.Object argsAsCons)
                                      throws java.lang.SecurityException,
                                             java.lang.NoSuchMethodException,
                                             java.lang.IllegalArgumentException,
                                             java.lang.IllegalAccessException,
                                             java.lang.reflect.InvocationTargetException,
                                             java.lang.NoSuchFieldException
Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchFieldException

instantiateJavaFunction

public static Function instantiateJavaFunction(java.lang.String classname)
                                        throws java.lang.InstantiationException,
                                               java.lang.IllegalAccessException,
                                               java.lang.ClassNotFoundException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException