|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jatha.Jatha
public class Jatha
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]
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 |
---|
private static boolean DEBUG
private String VERSION_NAME
private int VERSION_MAJOR
private int VERSION_MINOR
private int VERSION_MICRO
private String VERSION_TYPE
private String VERSION_DATE
private String VERSION_URL
public LispEvaluator EVAL
public LispPackage PACKAGE
LispPackage
public LispValue PACKAGE_SYMBOL
public SymbolTable SYMTAB
LispPackage
public SECDMachine MACHINE
SECDMachine
public LispCompiler COMPILER
LispCompiler
public final Runtime SYSTEM_INFO
Runtime
public LispParser PARSER
LispParser
public Listener LISTENER
Listener
public static int APROPOS_TAB
public LispValue DOT
public LispConsOrNil NIL
public LispValue QUOTE
public LispValue BACKQUOTE
public LispValue LIST
public LispValue APPEND
public LispValue CONS
public LispValue COMMA_FN
public LispValue COMMA_ATSIGN_FN
public LispValue COMMA_DOT_FN
public LispValue COLON
public LispValue NEWLINE
public LispValue SPACE
public LispValue STRING
public LispValue ZERO
public LispValue ONE
public LispValue TWO
public LispValue PI
public LispValue E
public LispValue T
public LispValue ARRAY_TYPE
public LispValue ATOM_TYPE
public LispValue BIGNUM_TYPE
public LispValue BOOLEAN_TYPE
public LispValue CHARACTER_TYPE
public LispValue COMPLEX_TYPE
public LispValue CONS_TYPE
public LispValue DOUBLE_FLOAT_TYPE
public LispValue FLOAT_TYPE
public LispValue FUNCTION_TYPE
public LispValue HASHTABLE_TYPE
public LispValue INTEGER_TYPE
public LispValue MACRO_TYPE
public LispValue NULL_TYPE
public LispValue NUMBER_TYPE
public LispValue PACKAGE_TYPE
public LispValue PATHNAME_TYPE
public LispValue REAL_TYPE
public LispValue STREAM_TYPE
public LispValue STRING_TYPE
public LispValue SYMBOL_TYPE
public LispValue VECTOR_TYPE
private LispPackage f_systemPackage
private LispPackage f_keywordPackage
LispValue prompt
LispValue userPrompt
LispValue packages
LispValue STAR
LispValue STARSTAR
LispValue STARSTARSTAR
LispValue MAX_LIST_LENGTH
LispValue LOAD_VERBOSE
static long MAX_LIST_LENGTH_VALUE
boolean useGUI
boolean useConsole
Constructor Detail |
---|
public Jatha()
public Jatha(boolean useGui)
public Jatha(boolean useGui, boolean useText)
public Jatha(boolean useDisplay, boolean useText, boolean showHelp)
Method Detail |
---|
public boolean isType(LispValue object)
object
- a LispSymbol
private void initializeConstants()
public void initConstants2()
public String getVersionString()
public String getVersionName()
public String getVersionDate()
public String getVersionURL()
public String getVersionType()
public int getVersionMajor()
public int getVersionMinor()
public int getVersionMicro()
void showHelp()
public LispInteger getMaxListLength()
public void setMaxListLength(long newLength)
public void setMaxListLength(LispNumber newLength)
public static void main(String[] args)
args
- public void init()
public void start()
protected void loadInitFiles()
public LispValue loadFromJar(LispValue filename, LispValue jarFile)
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.
public LispValue loadFromJar(String filename, String jarFileString)
filename
- The file to be loaded, WITHOUT an initial "/".jarFileString
- The name of the jar file to load the file from.
public LispValue loadFromJar(LispValue filename)
filename
- The file to be loaded, without an initial "/". Will be converted to a Java String using toStringSimple.
public LispValue loadFromJar(String filename)
filename
- The file to be loaded, WITHOUT an initial "/".
public LispValue eval(String expr)
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)");
public LispValue eval(LispValue inValue)
inValue
- a parsed LISP expression, such as the output from Jatha.parse().parse(String)
public LispValue eval(LispValue inValue, LispValue vars)
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)))parse(String)
private LispValue parseVarNames(LispValue vars)
private LispValue parseVarNames_new(LispValue vars)
private LispValue parseVarValues_new(LispValue vars)
private LispValue parseVarValues(LispValue vars)
void readEvalPrintLoop()
public LispCompiler getCompiler()
public LispParser getParser()
public LispEvaluator getEval()
public SymbolTable getSymbolTable()
public LispValue parse(String s, int caseSensitivity) throws EOFException
EOFException
public LispValue parse(String s) throws EOFException
EOFException
public LispValue load(Reader in) throws IOException, CompilerException
IOException
CompilerException
public LispValue load(Reader in, boolean verbose) throws IOException, CompilerException
IOException
CompilerException
public LispValue load(LispValue filenameVal)
public LispValue load(String string)
public LispValue load(String string, boolean verbose)
public LispValue findPackage(LispValue packageName)
packageName
- a LISP string or keyword
public LispValue findPackage(String packageNameStr)
public LispValue allPackages()
public LispValue apropos(LispValue str, LispValue pkg)
str
- - a LispString to matchpkg
- - either NIL or a packagepublic long free()
Runtime
public long free(PrintStream out)
public void javaTrace(boolean on)
on
- Runtime
public void gc()
Runtime
public void gc_full()
Runtime
public LispPackage defpackage(LispValue args)
args
- is not used
public LispValue makePackage(LispValue name, LispValue nickNames, LispValue use)
name
- the name of the package. may be a string or a symbolnickNames
- a list of nicknames. the content must be strings or symbolsuse
- a list of package names to use. may be strings or symbols.
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
public LispCons makeCons(LispValue theCar, LispValue theCdr)
theCar
- theCdr
-
LispCons
public LispConsOrNil makeList(Collection elements)
LispValue
public LispConsOrNil makeList(LispValue... parts)
public LispConsOrNil makeAppendList(Collection elements)
public LispConsOrNil makeNconcList(Collection elements)
public LispInteger makeInteger(Long value)
LispInteger
,
LispValue
public LispInteger makeInteger(long value)
public LispInteger makeInteger(Integer value)
public LispInteger makeInteger(int value)
public LispInteger makeInteger()
public LispBignum makeBignum(BigInteger value)
LispBignum
,
BigInteger
public LispBignum makeBignum(LispInteger value)
public LispBignum makeBignum(double value)
public LispBignum makeBignum(long value)
public LispReal makeReal(Double value)
LispInteger
,
LispValue
public LispReal makeReal(double value)
public LispReal makeReal(Float value)
public LispReal makeReal(float value)
public LispReal makeReal()
public LispString makeString(String str)
LispString
,
LispValue
public LispSymbol makeSymbol(String symbolName)
LispSymbol
,
LispValue
public LispSymbol makeSymbol(LispString symbolName)
public LispSymbol makeConstant(String symbolName)
LispConstant
,
LispSymbol
,
LispValue
public LispSymbol makeConstant(LispString symbolName)
public LispSymbol makeKeyword(String symbolName)
LispKeyword
,
LispConstant
,
LispSymbol
,
LispValue
public LispSymbol makeKeyword(LispString symbolName)
public LispNil makeNIL(String symbolName)
LispNil
,
LispCons
,
LispSymbol
,
LispValue
public LispNil makeNIL(LispString symbolName)
public LispValue toLisp(Object obj)
obj
- public LispValue combineExprs(LispValue left, LispValue right, LispValue expr)
public LispValue backquote(LispValue expr)
public void exit()
|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |