Jatha Software

org.jatha
Class Jatha

java.lang.Object
  extended by org.jatha.Jatha
All Implemented Interfaces:
ActionListener, EventListener

public class Jatha
extends Object
implements ActionListener

Jatha is an Applet supporting a subset of Common LISP, with extensions to support some features of Java such as networking and graphical interfaces.

Usage: java org.jatha.Jatha [-nodisplay] [-help]


Field Summary
 LispValue APPEND
           
static int APROPOS_TAB
          JATHA is a pointer to the Applet.
 LispValue ARRAY_TYPE
           
 LispValue ATOM_TYPE
           
 LispValue BACKQUOTE
           
 LispValue BIGNUM_TYPE
           
 LispValue BOOLEAN_TYPE
           
 LispValue CHARACTER_TYPE
           
 LispValue COLON
           
 LispValue COMMA_ATSIGN_FN
           
 LispValue COMMA_DOT_FN
           
 LispValue COMMA_FN
           
 LispCompiler COMPILER
          COMPILER is a pointer to a LispCompiler.
 LispValue COMPLEX_TYPE
           
 LispValue CONS
           
 LispValue CONS_TYPE
           
private static boolean DEBUG
           
 LispValue DOT
           
 LispValue DOUBLE_FLOAT_TYPE
           
 LispValue E
           
 LispEvaluator EVAL
          EVAL is a pointer to a LISP evaluator.
private  LispPackage f_keywordPackage
           
private  LispPackage f_systemPackage
           
 LispValue FLOAT_TYPE
           
 LispValue FUNCTION_TYPE
           
 LispValue HASHTABLE_TYPE
           
 LispValue INTEGER_TYPE
           
 LispValue LIST
           
 Listener LISTENER
          Listener is a pointer to the I/O Window.
(package private)  LispValue LOAD_VERBOSE
           
 SECDMachine MACHINE
          MACHINE is a pointer to the primary SECD abstract machine used for executing compiled LISP code.
 LispValue MACRO_TYPE
           
(package private)  LispValue MAX_LIST_LENGTH
           
(package private) static long MAX_LIST_LENGTH_VALUE
           
 LispValue NEWLINE
           
 LispConsOrNil NIL
           
 LispValue NULL_TYPE
           
 LispValue NUMBER_TYPE
           
 LispValue ONE
           
 LispPackage PACKAGE
          PACKAGE is a pointer to the current package (*package*).
 LispValue PACKAGE_SYMBOL
           
 LispValue PACKAGE_TYPE
           
(package private)  LispValue packages
           
 LispParser PARSER
          PARSER is a pointer to the main parser used by Jatha.
 LispValue PATHNAME_TYPE
           
 LispValue PI
           
(package private)  LispValue prompt
           
 LispValue QUOTE
           
 LispValue REAL_TYPE
           
 LispValue SPACE
           
(package private)  LispValue STAR
           
(package private)  LispValue STARSTAR
           
(package private)  LispValue STARSTARSTAR
           
 LispValue STREAM_TYPE
           
 LispValue STRING
           
 LispValue STRING_TYPE
           
 LispValue SYMBOL_TYPE
           
 SymbolTable SYMTAB
          SYMTAB is a pointer to the namespace used by LISP.
 Runtime SYSTEM_INFO
          SYSTEM_INFO is a pointer to the Runtime object for this Applet.
 LispValue T
           
 LispValue TWO
           
(package private)  boolean useConsole
           
(package private)  boolean useGUI
           
(package private)  LispValue userPrompt
           
 LispValue VECTOR_TYPE
           
private  String VERSION_DATE
           
private  int VERSION_MAJOR
           
private  int VERSION_MICRO
           
private  int VERSION_MINOR
           
private  String VERSION_NAME
           
private  String VERSION_TYPE
           
private  String VERSION_URL
           
 LispValue ZERO
           
 
Constructor Summary
Jatha()
          Create a new Jatha that does not use the GUI, does use the console for I/O and does not display help.
Jatha(boolean useGui)
          Create a new Jatha that optionally uses the GUI, does use the console for I/O and does not display help.
Jatha(boolean useGui, boolean useText)
          Create a new Jatha that optionally uses the GUI, optionally uses the console for I/O and does not display help.
Jatha(boolean useDisplay, boolean useText, boolean showHelp)
          Create a new Jatha that optionally uses the GUI, optionally uses the console for I/O and optionally displays help.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Invoked when an action occurs.
 LispValue allPackages()
           
 LispValue apropos(LispValue str, LispValue pkg)
          Prints out all symbols in the given package, or in all packages (if pkg is NIL) that match the given string.
 LispValue backquote(LispValue expr)
          This is used to expand a macro
 LispValue combineExprs(LispValue left, LispValue right, LispValue expr)
          This is used by f-backquote when expanding a macro.
 LispPackage defpackage(LispValue args)
          This is not yet implemented.
 LispValue eval(LispValue inValue)
          Standard LISP eval function.
 LispValue eval(LispValue inValue, LispValue vars)
          Standard LISP eval function.
 LispValue eval(String expr)
          Evaluates a LISP expression in a Java string, such as "(* 5 7)".
 void exit()
          Use this to exit Jatha.
 LispValue findPackage(LispValue packageName)
          Looks up the package on the packages list.
 LispValue findPackage(String packageNameStr)
           
 long free()
          This method prints out information on the amount of memory free in the Java space.
 long free(PrintStream out)
           
 void gc_full()
          This method causes the Java runtime to performs a GC.
 void gc()
          This method causes the Java runtime to performs a GC.
 LispCompiler getCompiler()
          Returns the LISP compiler used by this instance of Jatha.
 LispEvaluator getEval()
          Returns the LISP evaluator used by this instance of Jatha.
 LispInteger getMaxListLength()
          Returns the value of *MAX-LIST-LENGTH*.
 LispParser getParser()
          Returns the LISP Parser used by this instance of Jatha.
 SymbolTable getSymbolTable()
          Returns the Symbol Table used by this instance of Jatha.
 String getVersionDate()
          Returns the date of this version as a string: "nn MONTH yyyy".
 int getVersionMajor()
          Returns the major version number, that is, 1 in version 1.2.3.
 int getVersionMicro()
          Returns the micro version number, that is, 3 in version 1.2.3.
 int getVersionMinor()
          Returns the minor version number, that is, 2 in version 1.2.3.
 String getVersionName()
          Returns the program name, e.g.
 String getVersionString()
          Returns the entire version string.
 String getVersionType()
          Returns the type of release: "production", "beta" or "alpha".
 String getVersionURL()
          Returns a URL where you can find info about Algernon.
 void init()
           
 void initConstants2()
           
private  void initializeConstants()
           
 boolean isType(LispValue object)
          This is used in apropos_print on StandardLispSymbol.
 void javaTrace(boolean on)
          This method turns Java method tracing on.
 LispValue load(LispValue filenameVal)
          Loads a file.
 LispValue load(Reader in)
          Loads the contents of a Reader (stream).
 LispValue load(Reader in, boolean verbose)
          Loads the contents of a Reader (stream).
 LispValue load(String string)
          Creates a reader from the input string and passes it to load(Reader).
 LispValue load(String string, boolean verbose)
          Creates a reader from the input string and passes it to load(Reader).
 LispValue loadFromJar(LispValue filename)
          Loads a file from the container holding this class.
 LispValue loadFromJar(LispValue filename, LispValue jarFile)
          Loads a file from the container holding this class.
 LispValue loadFromJar(String filename)
          Loads a file from the container holding this class.
 LispValue loadFromJar(String filename, String jarFileString)
          Loads a file from the container holding this class.
protected  void loadInitFiles()
          Loads files in the /init directory in Jatha's jar file.
static void main(String[] args)
          With no arguments, creates a Jatha LISP Listener window and enables the Console I/O stream.
 LispConsOrNil makeAppendList(Collection elements)
          Each element of the collection should be a LispConsOrNil.
 LispBignum makeBignum(BigInteger value)
          Creates a LispBignum type initialized with the value provided.
 LispBignum makeBignum(double value)
           
 LispBignum makeBignum(LispInteger value)
           
 LispBignum makeBignum(long value)
           
 LispCons makeCons(LispValue theCar, LispValue theCdr)
          makeCons(a,b) creates a new Cons cell, initialized with the values a and b as the CAR and CDR respectively.
 LispSymbol makeConstant(LispString symbolName)
           
 LispSymbol makeConstant(String symbolName)
          Creates a LispConstant (a type of Symbol whose value can not be changed).
 LispInteger makeInteger()
           
 LispInteger makeInteger(int value)
           
 LispInteger makeInteger(Integer value)
           
 LispInteger makeInteger(long value)
           
 LispInteger makeInteger(Long value)
          Creates a LispInteger type initialized with the value provided and returns it.
 LispSymbol makeKeyword(LispString symbolName)
           
 LispSymbol makeKeyword(String symbolName)
          Creates a LispKeyword (a type of Symbol that evaluates to itself).
 LispConsOrNil makeList(Collection elements)
          Creates a LISP list from the elements of the Collection.
 LispConsOrNil makeList(LispValue... parts)
          This is a Java 5-compatible version of makeList that accepts any number of arguments.
 LispConsOrNil makeNconcList(Collection elements)
          Each element of the collection should be a LispConsOrNil.
 LispNil makeNIL(LispString symbolName)
           
 LispNil makeNIL(String symbolName)
          Creates a LispNil (the funny symbol/cons that is the LISP NIL).
 LispValue makePackage(LispValue name, LispValue nickNames, LispValue use)
          Creates a package and returns it.
 LispReal makeReal()
           
 LispReal makeReal(double value)
           
 LispReal makeReal(Double value)
          Creates an instance of LispReal initialized with the given value.
 LispReal makeReal(float value)
           
 LispReal makeReal(Float value)
           
 LispString makeString(String str)
          Creates a LispString from a Java string.
 LispSymbol makeSymbol(LispString symbolName)
           
 LispSymbol makeSymbol(String symbolName)
          Creates a LispSymbol from a string or LispString.
 LispValue parse(String s)
          Parses a string and returns the first form in the string.
 LispValue parse(String s, int caseSensitivity)
          Parses a string and returns the first form in the string.
private  LispValue parseVarNames_new(LispValue vars)
          Not sure why parseVarNames has such a complicated structure.
private  LispValue parseVarNames(LispValue vars)
          Expects a list with this format (((A 13) (C 7))((X "Zeta"))) and returns a list with this format ((A C)(X))
private  LispValue parseVarValues_new(LispValue vars)
          Not sure why parseVarNames has such a complicated structure.
private  LispValue parseVarValues(LispValue vars)
          Expects a list with this format (((A 13) (C 7))((X "Zeta"))) and returns a list with this format ((13 7)("Zeta"))
(package private)  void readEvalPrintLoop()
           
 void setMaxListLength(LispNumber newLength)
          Sets the value of *MAX-LIST-LENGTH*.
 void setMaxListLength(long newLength)
          Sets the value of *MAX-LIST-LENGTH*.
(package private)  void showHelp()
           
 void start()
           
 LispValue toLisp(Object obj)
          Turns a Java object into a LISP object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static boolean DEBUG

VERSION_NAME

private String VERSION_NAME

VERSION_MAJOR

private int VERSION_MAJOR

VERSION_MINOR

private int VERSION_MINOR

VERSION_MICRO

private int VERSION_MICRO

VERSION_TYPE

private String VERSION_TYPE

VERSION_DATE

private String VERSION_DATE

VERSION_URL

private String VERSION_URL

EVAL

public LispEvaluator EVAL
EVAL is a pointer to a LISP evaluator. Used for evaluating LISP expressions in Java code.


PACKAGE

public LispPackage PACKAGE
PACKAGE is a pointer to the current package (*package*). Its SYMTAB is always the curent SYMTAB of Jatha.

See Also:
LispPackage

PACKAGE_SYMBOL

public LispValue PACKAGE_SYMBOL

SYMTAB

public SymbolTable SYMTAB
SYMTAB is a pointer to the namespace used by LISP. Needed for initialization of the parser. It is always the SYMTAB of the current PACKAGE;

See Also:
LispPackage

MACHINE

public SECDMachine MACHINE
MACHINE is a pointer to the primary SECD abstract machine used for executing compiled LISP code.

See Also:
SECDMachine

COMPILER

public LispCompiler COMPILER
COMPILER is a pointer to a LispCompiler.

See Also:
LispCompiler

SYSTEM_INFO

public final Runtime SYSTEM_INFO
SYSTEM_INFO is a pointer to the Runtime object for this Applet.

See Also:
Runtime

PARSER

public LispParser PARSER
PARSER is a pointer to the main parser used by Jatha. Others may be instantiated to deal with String or Stream input.

See Also:
LispParser

LISTENER

public Listener LISTENER
Listener is a pointer to the I/O Window.

See Also:
Listener

APROPOS_TAB

public static int APROPOS_TAB
JATHA is a pointer to the Applet.


DOT

public LispValue DOT

NIL

public LispConsOrNil NIL

QUOTE

public LispValue QUOTE

BACKQUOTE

public LispValue BACKQUOTE

LIST

public LispValue LIST

APPEND

public LispValue APPEND

CONS

public LispValue CONS

COMMA_FN

public LispValue COMMA_FN

COMMA_ATSIGN_FN

public LispValue COMMA_ATSIGN_FN

COMMA_DOT_FN

public LispValue COMMA_DOT_FN

COLON

public LispValue COLON

NEWLINE

public LispValue NEWLINE

SPACE

public LispValue SPACE

STRING

public LispValue STRING

ZERO

public LispValue ZERO

ONE

public LispValue ONE

TWO

public LispValue TWO

PI

public LispValue PI

E

public LispValue E

T

public LispValue T

ARRAY_TYPE

public LispValue ARRAY_TYPE

ATOM_TYPE

public LispValue ATOM_TYPE

BIGNUM_TYPE

public LispValue BIGNUM_TYPE

BOOLEAN_TYPE

public LispValue BOOLEAN_TYPE

CHARACTER_TYPE

public LispValue CHARACTER_TYPE

COMPLEX_TYPE

public LispValue COMPLEX_TYPE

CONS_TYPE

public LispValue CONS_TYPE

DOUBLE_FLOAT_TYPE

public LispValue DOUBLE_FLOAT_TYPE

FLOAT_TYPE

public LispValue FLOAT_TYPE

FUNCTION_TYPE

public LispValue FUNCTION_TYPE

HASHTABLE_TYPE

public LispValue HASHTABLE_TYPE

INTEGER_TYPE

public LispValue INTEGER_TYPE

MACRO_TYPE

public LispValue MACRO_TYPE

NULL_TYPE

public LispValue NULL_TYPE

NUMBER_TYPE

public LispValue NUMBER_TYPE

PACKAGE_TYPE

public LispValue PACKAGE_TYPE

PATHNAME_TYPE

public LispValue PATHNAME_TYPE

REAL_TYPE

public LispValue REAL_TYPE

STREAM_TYPE

public LispValue STREAM_TYPE

STRING_TYPE

public LispValue STRING_TYPE

SYMBOL_TYPE

public LispValue SYMBOL_TYPE

VECTOR_TYPE

public LispValue VECTOR_TYPE

f_systemPackage

private LispPackage f_systemPackage

f_keywordPackage

private LispPackage f_keywordPackage

prompt

LispValue prompt

userPrompt

LispValue userPrompt

packages

LispValue packages

STAR

LispValue STAR

STARSTAR

LispValue STARSTAR

STARSTARSTAR

LispValue STARSTARSTAR

MAX_LIST_LENGTH

LispValue MAX_LIST_LENGTH

LOAD_VERBOSE

LispValue LOAD_VERBOSE

MAX_LIST_LENGTH_VALUE

static long MAX_LIST_LENGTH_VALUE

useGUI

boolean useGUI

useConsole

boolean useConsole
Constructor Detail

Jatha

public Jatha()
Create a new Jatha that does not use the GUI, does use the console for I/O and does not display help.


Jatha

public Jatha(boolean useGui)
Create a new Jatha that optionally uses the GUI, does use the console for I/O and does not display help.


Jatha

public Jatha(boolean useGui,
             boolean useText)
Create a new Jatha that optionally uses the GUI, optionally uses the console for I/O and does not display help.


Jatha

public Jatha(boolean useDisplay,
             boolean useText,
             boolean showHelp)
Create a new Jatha that optionally uses the GUI, optionally uses the console for I/O and optionally displays help.

Method Detail

isType

public boolean isType(LispValue object)
This is used in apropos_print on StandardLispSymbol. Not really for public consumption.

Parameters:
object - a LispSymbol
Returns:
true if it is equal to ARRAY_TYPE, ATOM_TYPE, etc.

initializeConstants

private void initializeConstants()

initConstants2

public void initConstants2()

getVersionString

public String getVersionString()
Returns the entire version string.

Returns:
a string containing the entire description of Algernon.

getVersionName

public String getVersionName()
Returns the program name, e.g. Algernon.


getVersionDate

public String getVersionDate()
Returns the date of this version as a string: "nn MONTH yyyy".


getVersionURL

public String getVersionURL()
Returns a URL where you can find info about Algernon.


getVersionType

public String getVersionType()
Returns the type of release: "production", "beta" or "alpha".


getVersionMajor

public int getVersionMajor()
Returns the major version number, that is, 1 in version 1.2.3.


getVersionMinor

public int getVersionMinor()
Returns the minor version number, that is, 2 in version 1.2.3.


getVersionMicro

public int getVersionMicro()
Returns the micro version number, that is, 3 in version 1.2.3.


showHelp

void showHelp()

getMaxListLength

public LispInteger getMaxListLength()
Returns the value of *MAX-LIST-LENGTH*. This value is only used to prevent runaway list processing.


setMaxListLength

public void setMaxListLength(long newLength)
Sets the value of *MAX-LIST-LENGTH*. This vlaue is only used to prevent runaway list processing.


setMaxListLength

public void setMaxListLength(LispNumber newLength)
Sets the value of *MAX-LIST-LENGTH*. This vlaue is only used to prevent runaway list processing.


main

public static void main(String[] args)
With no arguments, creates a Jatha LISP Listener window and enables the Console I/O stream. The user can optionally specify -nodisplay to use the console for input.

Parameters:
args -

init

public void init()

start

public void start()

loadInitFiles

protected void loadInitFiles()
Loads files in the /init directory in Jatha's jar file. They must be named "01.lisp", "02.lisp", etc. Numbers must be sequential starting from "01".


loadFromJar

public LispValue loadFromJar(LispValue filename,
                             LispValue jarFile)
Loads a file from the container holding this class. The container is normally a JAR file. Uses getResource to create a stream, then calls load(Reader).

Parameters:
filename - The file to be loaded, without an initial "/". Will be converted to a Java String using toStringSimple.
jarFile - The URL of the jar file from which to load the resource.
Returns:
T if the file was successfully loaded, NIL if the file doesn't exist and a String containing an error message otherwise.

loadFromJar

public LispValue loadFromJar(String filename,
                             String jarFileString)
Loads a file from the container holding this class. The container is normally a JAR file. Uses getResource to create a stream, then calls load(Reader).

Parameters:
filename - The file to be loaded, WITHOUT an initial "/".
jarFileString - The name of the jar file to load the file from.
Returns:
T if the file was successfully loaded, NIL if the file doesn't exist and a String containing an error message otherwise.

loadFromJar

public LispValue loadFromJar(LispValue filename)
Loads a file from the container holding this class. The container is normally a JAR file. Uses getResource to create a stream, then calls load(Reader).

Parameters:
filename - The file to be loaded, without an initial "/". Will be converted to a Java String using toStringSimple.
Returns:
T if the file was successfully loaded, NIL if the file doesn't exist and a String containing an error message otherwise.

loadFromJar

public LispValue loadFromJar(String filename)
Loads a file from the container holding this class. The container is normally a JAR file. Uses getResource to create a stream, then calls load(Reader).

Parameters:
filename - The file to be loaded, WITHOUT an initial "/".
Returns:
T if the file was successfully loaded, NIL if the file doesn't exist and a String containing an error message otherwise.

eval

public LispValue eval(String expr)
Evaluates a LISP expression in a Java string, such as "(* 5 7)". To evaluate an expression with variables, there are several options:
   eval("(let ((x 7)) (* 5 x)))");
   eval("(progn (setq x 7) (* 5 x))");
 
Or use separate eval statements:
   eval("setq x 7");
   eval("(* 5 x)");
 


eval

public LispValue eval(LispValue inValue)
Standard LISP eval function.

Parameters:
inValue - a parsed LISP expression, such as the output from Jatha.parse().
See Also:
parse(String)

eval

public LispValue eval(LispValue inValue,
                      LispValue vars)
Standard LISP eval function.

Parameters:
inValue - a parsed LISp expression such as the output from Jatha.parse()
vars - a nested list of global variables and values, such as (((a . 3) (b . 5)) ((c . 10)))
See Also:
parse(String)

parseVarNames

private LispValue parseVarNames(LispValue vars)
Expects a list with this format (((A 13) (C 7))((X "Zeta"))) and returns a list with this format ((A C)(X))


parseVarNames_new

private LispValue parseVarNames_new(LispValue vars)
Not sure why parseVarNames has such a complicated structure. This one expects variables of the form ((A . 7) (B . 13) (C . (foo))) the CAR of each pair is the variable and the CDR of each pair is the value.


parseVarValues_new

private LispValue parseVarValues_new(LispValue vars)
Not sure why parseVarNames has such a complicated structure. This one expects variables of the form ((A . 7) (B . 13) (C . (foo))) the CAR of each pair is the variable and the CDR of each pair is the value.


parseVarValues

private LispValue parseVarValues(LispValue vars)
Expects a list with this format (((A 13) (C 7))((X "Zeta"))) and returns a list with this format ((13 7)("Zeta"))


readEvalPrintLoop

void readEvalPrintLoop()

getCompiler

public LispCompiler getCompiler()
Returns the LISP compiler used by this instance of Jatha.


getParser

public LispParser getParser()
Returns the LISP Parser used by this instance of Jatha.


getEval

public LispEvaluator getEval()
Returns the LISP evaluator used by this instance of Jatha.


getSymbolTable

public SymbolTable getSymbolTable()
Returns the Symbol Table used by this instance of Jatha.


parse

public LispValue parse(String s,
                       int caseSensitivity)
                throws EOFException
Parses a string and returns the first form in the string.
caseSensitivity:

Throws:
EOFException

parse

public LispValue parse(String s)
                throws EOFException
Parses a string and returns the first form in the string.

Throws:
EOFException

load

public LispValue load(Reader in)
               throws IOException,
                      CompilerException
Loads the contents of a Reader (stream). Useful for loading from a jar file. Contributed by Stephen Starkey.

Throws:
IOException
CompilerException

load

public LispValue load(Reader in,
                      boolean verbose)
               throws IOException,
                      CompilerException
Loads the contents of a Reader (stream). Useful for loading from a jar file. Contributed by Stephen Starkey.

Throws:
IOException
CompilerException

load

public LispValue load(LispValue filenameVal)
Loads a file. Argument is guaranteed to be a LispString.


load

public LispValue load(String string)
Creates a reader from the input string and passes it to load(Reader). Verbose is false.


load

public LispValue load(String string,
                      boolean verbose)
Creates a reader from the input string and passes it to load(Reader).


findPackage

public LispValue findPackage(LispValue packageName)
Looks up the package on the packages list. Input should be a string, symbol or package. All names and nicknames are searched.

Parameters:
packageName - a LISP string or keyword
Returns:
LispValue the package, or NIL

findPackage

public LispValue findPackage(String packageNameStr)

allPackages

public LispValue allPackages()

apropos

public LispValue apropos(LispValue str,
                         LispValue pkg)
Prints out all symbols in the given package, or in all packages (if pkg is NIL) that match the given string. Matching is *NOT* case-sensitive and the string may match a portion of the symbol name.

Parameters:
str - - a LispString to match
pkg - - either NIL or a package

free

public long free()
This method prints out information on the amount of memory free in the Java space. It optionally takes an PrintStream as an argument, but defaults to System.out.

Returns:
void
See Also:
Runtime

free

public long free(PrintStream out)

javaTrace

public void javaTrace(boolean on)
This method turns Java method tracing on. Right now, this doesn't seem to do anything, but perhaps we need to compile with debugging turned on.

Parameters:
on -
See Also:
Runtime

gc

public void gc()
This method causes the Java runtime to performs a GC.

See Also:
Runtime

gc_full

public void gc_full()
This method causes the Java runtime to performs a GC. It calls the runFinalization() method first, in order to reclaim as much memory as possible.

See Also:
Runtime

defpackage

public LispPackage defpackage(LispValue args)
This is not yet implemented. Returns the current value of Jatha.PACKAGE.

Parameters:
args - is not used
Returns:
Jatha.PACKAGE

makePackage

public LispValue makePackage(LispValue name,
                             LispValue nickNames,
                             LispValue use)
Creates a package and returns it. If it already exists, a cerror is reported.

Parameters:
name - the name of the package. may be a string or a symbol
nickNames - a list of nicknames. the content must be strings or symbols
use - a list of package names to use. may be strings or symbols.
Returns:
Jatha.PACKAGE

actionPerformed

public void actionPerformed(ActionEvent event)
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener

makeCons

public LispCons makeCons(LispValue theCar,
                         LispValue theCdr)
makeCons(a,b) creates a new Cons cell, initialized with the values a and b as the CAR and CDR respectively.

Parameters:
theCar -
theCdr -
Returns:
LispValue
See Also:
LispCons

makeList

public LispConsOrNil makeList(Collection elements)
Creates a LISP list from the elements of the Collection. which must be LispValue types.

See Also:
LispValue

makeList

public LispConsOrNil makeList(LispValue... parts)
This is a Java 5-compatible version of makeList that accepts any number of arguments. Returns NIL if no arguments are passed. makeList(NIL) returns (NIL) - a list containing NIL.


makeAppendList

public LispConsOrNil makeAppendList(Collection elements)
Each element of the collection should be a LispConsOrNil. The elements will be non-destructively appended to each other. The result is one list. Note that this operation is expensive in terms of storage.


makeNconcList

public LispConsOrNil makeNconcList(Collection elements)
Each element of the collection should be a LispConsOrNil. The elements will be destructively appended to each other. The result is one list.


makeInteger

public LispInteger makeInteger(Long value)
Creates a LispInteger type initialized with the value provided and returns it.

Returns:
LispInteger
See Also:
LispInteger, LispValue

makeInteger

public LispInteger makeInteger(long value)

makeInteger

public LispInteger makeInteger(Integer value)

makeInteger

public LispInteger makeInteger(int value)

makeInteger

public LispInteger makeInteger()

makeBignum

public LispBignum makeBignum(BigInteger value)
Creates a LispBignum type initialized with the value provided.

See Also:
LispBignum, BigInteger

makeBignum

public LispBignum makeBignum(LispInteger value)

makeBignum

public LispBignum makeBignum(double value)

makeBignum

public LispBignum makeBignum(long value)

makeReal

public LispReal makeReal(Double value)
Creates an instance of LispReal initialized with the given value.

Returns:
LispReal
See Also:
LispInteger, LispValue

makeReal

public LispReal makeReal(double value)

makeReal

public LispReal makeReal(Float value)

makeReal

public LispReal makeReal(float value)

makeReal

public LispReal makeReal()

makeString

public LispString makeString(String str)
Creates a LispString from a Java string.

Returns:
LispString
See Also:
LispString, LispValue

makeSymbol

public LispSymbol makeSymbol(String symbolName)
Creates a LispSymbol from a string or LispString. This method does not intern the symbol.

Returns:
LispSymbol
See Also:
LispSymbol, LispValue

makeSymbol

public LispSymbol makeSymbol(LispString symbolName)

makeConstant

public LispSymbol makeConstant(String symbolName)
Creates a LispConstant (a type of Symbol whose value can not be changed). This method does not intern the symbol.

Returns:
LispSymbol
See Also:
LispConstant, LispSymbol, LispValue

makeConstant

public LispSymbol makeConstant(LispString symbolName)

makeKeyword

public LispSymbol makeKeyword(String symbolName)
Creates a LispKeyword (a type of Symbol that evaluates to itself). This method does not intern the symbol.

Returns:
LispSymbol
See Also:
LispKeyword, LispConstant, LispSymbol, LispValue

makeKeyword

public LispSymbol makeKeyword(LispString symbolName)

makeNIL

public LispNil makeNIL(String symbolName)
Creates a LispNil (the funny symbol/cons that is the LISP NIL). This method does not intern the symbol.

Returns:
LispSymbol
See Also:
LispNil, LispCons, LispSymbol, LispValue

makeNIL

public LispNil makeNIL(LispString symbolName)

toLisp

public LispValue toLisp(Object obj)
Turns a Java object into a LISP object.

Parameters:
obj -

combineExprs

public LispValue combineExprs(LispValue left,
                              LispValue right,
                              LispValue expr)
This is used by f-backquote when expanding a macro.


backquote

public LispValue backquote(LispValue expr)
This is used to expand a macro


exit

public void exit()
Use this to exit Jatha.


Jatha Software