| java.lang.Object org.jatha.Jatha
Jatha | public class Jatha extends Object implements ActionListener(Code) | | 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]
author: Micheal S. Hewett hewett@cs.stanford.edu |
Constructor Summary | |
public | Jatha() Create a new Jatha that does not use the GUI, does use the console for I/O and does not display help. | 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. | 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. | 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 Summary | |
public void | actionPerformed(ActionEvent event) Invoked when an action occurs. | public LispValue | allPackages() | 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. | public LispValue | backquote(LispValue expr) | public LispValue | combineExprs(LispValue left, LispValue right, LispValue expr) This is used by f-backquote when expanding a macro. | public LispPackage | defpackage(LispValue args) This is not yet implemented. | public LispValue | eval(String expr) Evaluates a LISP expression in a Java string, such as "(* 5 7)". | public LispValue | eval(LispValue inValue) Standard LISP eval function. | public LispValue | eval(LispValue inValue, LispValue vars) Standard LISP eval function.
Parameters: inValue - a parsed LISp expression such as the output from Jatha.parse() Parameters: vars - a nested list of global variables and values, such as (((a . | public void | exit() Use this to exit Jatha. | public LispValue | findPackage(LispValue packageName) Looks up the package on the packages list.
Input should be a string, symbol or package. | public LispValue | findPackage(String packageNameStr) | public long | free() This method prints out information on the amount of
memory free in the Java space. | public long | free(PrintStream out) | public void | gc() This method causes the Java runtime to performs a GC. | public void | gc_full() This method causes the Java runtime to performs
a GC. | public LispCompiler | getCompiler() Returns the LISP compiler used by this instance of Jatha. | public LispEvaluator | getEval() Returns the LISP evaluator used by this instance of Jatha. | public LispInteger | getMaxListLength() Returns the value of *MAX-LIST-LENGTH*. | public LispParser | getParser() Returns the LISP Parser used by this instance of Jatha. | public SymbolTable | getSymbolTable() Returns the Symbol Table used by this instance of Jatha. | public String | getVersionDate() Returns the date of this version as a string: "nn MONTH yyyy". | public int | getVersionMajor() Returns the major version number, that is, 1 in version 1.2.3. | public int | getVersionMicro() Returns the micro version number, that is, 3 in version 1.2.3. | public int | getVersionMinor() Returns the minor version number, that is, 2 in version 1.2.3. | public String | getVersionName() Returns the program name, e.g. | public String | getVersionString() Returns the entire version string. | public String | getVersionType() Returns the type of release: "production", "beta" or "alpha". | public String | getVersionURL() Returns a URL where you can find info about Algernon. | public void | init() | public void | initConstants2() | public boolean | isType(LispValue object) This is used in apropos_print on StandardLispSymbol. | public void | javaTrace(boolean on) This method turns Java method tracing on. | public LispValue | load(Reader in) Loads the contents of a Reader (stream). | public LispValue | load(Reader in, boolean verbose) Loads the contents of a Reader (stream). | public LispValue | load(LispValue filenameVal) Loads a file. | public LispValue | load(String string) Creates a reader from the input string and passes it to load(Reader). | public LispValue | load(String string, boolean verbose) Creates a reader from the input string and passes it to load(Reader). | 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 "/". | 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 "/". Parameters: jarFileString - The name of the jar file to load the file from. | 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 "/". | 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 "/". | protected void | loadInitFiles() Loads files in the /init directory in Jatha's jar file.
They must be named "01.lisp", "02.lisp", etc. | public static void | main(String args) With no arguments, creates a Jatha LISP Listener window
and enables the Console I/O stream. | public LispConsOrNil | makeAppendList(Collection elements) Each element of the collection should be a LispConsOrNil. | public LispBignum | makeBignum(BigInteger value) Creates a LispBignum type initialized with the value provided. | public LispBignum | makeBignum(LispInteger value) | public LispBignum | makeBignum(double value) | public LispBignum | makeBignum(long value) | 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. | public LispSymbol | makeConstant(String symbolName) Creates a LispConstant (a type of Symbol whose value
can not be changed). | public LispSymbol | makeConstant(LispString symbolName) | public LispInteger | makeInteger(Long value) Creates a LispInteger type initialized with the value
provided and returns it. | public LispInteger | makeInteger(long value) | public LispInteger | makeInteger(Integer value) | public LispInteger | makeInteger(int value) | public LispInteger | makeInteger() | public LispSymbol | makeKeyword(String symbolName) Creates a LispKeyword (a type of Symbol that evaluates
to itself). | public LispSymbol | makeKeyword(LispString symbolName) | public LispConsOrNil | makeList(Collection elements) Creates a LISP list from the elements of the Collection. | public LispConsOrNil | makeList(LispValue... parts) This is a Java 5-compatible version of makeList that
accepts any number of arguments. | public LispNil | makeNIL(String symbolName) Creates a LispNil (the funny symbol/cons that is the LISP NIL). | public LispNil | makeNIL(LispString symbolName) | public LispConsOrNil | makeNconcList(Collection elements) Each element of the collection should be a LispConsOrNil. | public LispValue | makePackage(LispValue name, LispValue nickNames, LispValue use) Creates a package and returns it. | public LispReal | makeReal(Double value) Creates an instance of LispReal initialized with
the given value. | public LispReal | makeReal(double value) | public LispReal | makeReal(Float value) | public LispReal | makeReal(float value) | public LispReal | makeReal() | public LispString | makeString(String str) Creates a LispString from a Java string. | public LispSymbol | makeSymbol(String symbolName) Creates a LispSymbol from a string or LispString. | public LispSymbol | makeSymbol(LispString symbolName) | public LispValue | parse(String s, int caseSensitivity) Parses a string and returns the first form in the string. | public LispValue | parse(String s) Parses a string and returns the first form in the string. | void | readEvalPrintLoop() | public void | setMaxListLength(long newLength) Sets the value of *MAX-LIST-LENGTH*. | public void | setMaxListLength(LispNumber newLength) Sets the value of *MAX-LIST-LENGTH*. | void | showHelp() | public void | start() | public LispValue | toLisp(Object obj) Turns a Java object into a LISP object. |
APROPOS_TAB | public static int APROPOS_TAB(Code) | | JATHA is a pointer to the Applet.
|
EVAL | public LispEvaluator EVAL(Code) | | EVAL is a pointer to a LISP evaluator.
Used for evaluating LISP expressions in Java code.
|
MAX_LIST_LENGTH_VALUE | static long MAX_LIST_LENGTH_VALUE(Code) | | |
useConsole | boolean useConsole(Code) | | |
Jatha | public Jatha()(Code) | | 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)(Code) | | 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)(Code) | | 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)(Code) | | Create a new Jatha that optionally uses the GUI, optionally uses the console for I/O and optionally displays help.
|
actionPerformed | public void actionPerformed(ActionEvent event)(Code) | | Invoked when an action occurs.
|
apropos | public LispValue apropos(LispValue str, LispValue pkg)(Code) | | 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 Parameters: pkg - - either NIL or a package |
defpackage | public LispPackage defpackage(LispValue args)(Code) | | This is not yet implemented. Returns the current value of Jatha.PACKAGE.
Parameters: args - is not used Jatha.PACKAGE |
eval | public LispValue eval(String expr)(Code) | | 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, LispValue vars)(Code) | | Standard LISP eval function.
Parameters: inValue - a parsed LISp expression such as the output from Jatha.parse() Parameters: vars - a nested list of global variables and values, such as (((a . 3) (b . 5)) ((c . 10))) See Also: Jatha.parse(String) |
exit | public void exit()(Code) | | Use this to exit Jatha.
|
findPackage | public LispValue findPackage(LispValue packageName)(Code) | | 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 LispValue the package, or NIL |
free | public long free()(Code) | | 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.
See Also: java.lang.Runtime void |
gc_full | public void gc_full()(Code) | | 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: java.lang.Runtime |
getCompiler | public LispCompiler getCompiler()(Code) | | Returns the LISP compiler used by this instance of Jatha.
|
getEval | public LispEvaluator getEval()(Code) | | Returns the LISP evaluator used by this instance of Jatha.
|
getMaxListLength | public LispInteger getMaxListLength()(Code) | | Returns the value of *MAX-LIST-LENGTH*.
This value is only used to prevent runaway list processing.
|
getParser | public LispParser getParser()(Code) | | Returns the LISP Parser used by this instance of Jatha.
|
getSymbolTable | public SymbolTable getSymbolTable()(Code) | | Returns the Symbol Table used by this instance of Jatha.
|
getVersionDate | public String getVersionDate()(Code) | | Returns the date of this version as a string: "nn MONTH yyyy".
|
getVersionMajor | public int getVersionMajor()(Code) | | Returns the major version number, that is, 1 in version 1.2.3.
|
getVersionMicro | public int getVersionMicro()(Code) | | Returns the micro version number, that is, 3 in version 1.2.3.
|
getVersionMinor | public int getVersionMinor()(Code) | | Returns the minor version number, that is, 2 in version 1.2.3.
|
getVersionName | public String getVersionName()(Code) | | Returns the program name, e.g. Algernon.
|
getVersionString | public String getVersionString()(Code) | | Returns the entire version string.
a string containing the entire description of Algernon. |
getVersionType | public String getVersionType()(Code) | | Returns the type of release: "production", "beta" or "alpha".
|
getVersionURL | public String getVersionURL()(Code) | | Returns a URL where you can find info about Algernon.
|
initConstants2 | public void initConstants2()(Code) | | |
isType | public boolean isType(LispValue object)(Code) | | This is used in apropos_print on StandardLispSymbol.
Not really for public consumption.
Parameters: object - a LispSymbol true if it is equal to ARRAY_TYPE, ATOM_TYPE, etc. |
javaTrace | public void javaTrace(boolean on)(Code) | | 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.
See Also: java.lang.Runtime Parameters: on - |
load | public LispValue load(String string)(Code) | | Creates a reader from the input string and passes it to load(Reader).
Verbose is false.
|
load | public LispValue load(String string, boolean verbose)(Code) | | Creates a reader from the input string and passes it to load(Reader).
|
loadFromJar | public LispValue loadFromJar(LispValue filename, LispValue jarFile)(Code) | | 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. Parameters: jarFile - The URL of the jar file from which to load the resource. 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)(Code) | | 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 "/". Parameters: jarFileString - The name of the jar file to load the file from. 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)(Code) | | 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. 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)(Code) | | 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 "/". T if the file was successfully loaded, NIL if the file doesn't exist and a String containing an error message otherwise. |
loadInitFiles | protected void loadInitFiles()(Code) | | 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".
|
main | public static void main(String args)(Code) | | 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 - |
makeAppendList | public LispConsOrNil makeAppendList(Collection elements)(Code) | | 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.
|
makeCons | public LispCons makeCons(LispValue theCar, LispValue theCdr)(Code) | | makeCons(a,b) creates a new Cons cell, initialized with
the values a and b as the CAR and CDR respectively.
See Also: LispCons Parameters: theCar - Parameters: theCdr - LispValue |
makeList | public LispConsOrNil makeList(LispValue... parts)(Code) | | 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.
|
makeNconcList | public LispConsOrNil makeNconcList(Collection elements)(Code) | | Each element of the collection should be a LispConsOrNil.
The elements will be destructively appended to each other.
The result is one list.
|
makePackage | public LispValue makePackage(LispValue name, LispValue nickNames, LispValue use)(Code) | | 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 Parameters: nickNames - a list of nicknames. the content must be strings or symbols Parameters: use - a list of package names to use. may be strings or symbols. Jatha.PACKAGE |
parse | public LispValue parse(String s, int caseSensitivity) throws EOFException(Code) | | Parses a string and returns the first form in the string.
caseSensitivity:
- LispParser.UPCASE (the default)
- LispParser.DOWNCASE
- LispParser.PRESERVE
|
readEvalPrintLoop | void readEvalPrintLoop()(Code) | | |
setMaxListLength | public void setMaxListLength(long newLength)(Code) | | Sets the value of *MAX-LIST-LENGTH*.
This vlaue is only used to prevent runaway list processing.
|
setMaxListLength | public void setMaxListLength(LispNumber newLength)(Code) | | Sets the value of *MAX-LIST-LENGTH*.
This vlaue is only used to prevent runaway list processing.
|
showHelp | void showHelp()(Code) | | |
start | public void start()(Code) | | |
toLisp | public LispValue toLisp(Object obj)(Code) | | Turns a Java object into a LISP object.
Parameters: obj - |
|
|