public class AppContext extends Util
Typically, an AppContext is created using the default constructor,
then initialized with a heap using utility methods in REPL
.
Modifier and Type | Field and Description |
---|---|
SymbolicEnvironment |
symenv |
SymbolicEnvironment |
toplevel_env |
BACKQUOTE, BEGIN, bundles, caseSensitive, EMPTYLIST, EMPTYVEC, EOF, ERRORK, EVAL, EXPSC, EXPTOP, FALSE, FCONT, FIVE, JEXCEPTION, LAMBDA, LOCATION, maxFloatPrecision, MESSAGE, minFloatPrecision, NAME, OTHER, PARENT, permitInterrupts, QUOTE, QUOTESYM, REPORT, SETBANG, SISC, SISC_SPECIFIC, SISCB, SOURCE_COLUMN, SOURCE_FILE, SOURCE_LINE, SYMENV, THIS, TOPLEVEL, TRUE, UNQUOTE, UNQUOTE_SPLICING, VOID, ZV
Constructor and Description |
---|
AppContext()
Create a new, AppContext with default values,
the recommended constructor for normal usage.
|
AppContext(java.util.Properties props)
Create a new AppContext, providing a set of properties explicitly.
|
AppContext(SymbolicEnvironment symenv)
Create a new AppContext, providing a custom global environment.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultHeap()
Attempts to find and load the default SISC heap into this
AppContext.
|
boolean |
addHeap(SeekableInputStream in)
Given a SeekableInputStream which
is attached to a SISC heap file, loads the heap into this
AppContext and initializes it.
|
void |
defineContextEnv(Symbol s,
SymbolicEnvironment env) |
static java.net.URL |
findHeap(java.net.URL heapLocation)
Locate a heap.
|
Expression |
getExpression(Symbol name) |
java.lang.String |
getProperty(java.lang.String name) |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String def) |
void |
loadEnv(SeekableDataInputStream i) |
LibraryBinding |
lookupBinding(Expression e) |
SymbolicEnvironment |
lookupContextEnv(Symbol s) |
static SeekableInputStream |
openHeap(java.net.URL u) |
Expression |
resolveBinding(LibraryBinding lb) |
void |
saveEnv(java.io.OutputStream o,
LibraryBuilder lb) |
annotated, annotatedAppEval, append, argCheck, argsToSymbols, assq, bininport, bininstream, binoutport, binoutstream, box, character, charinport, charinreader, charoutport, charoutwriter, charsetFromString, chr, cont, currentClassLoader, env, error, error, error, error, error, error, error, expr, getDefaultCharacterSet, immutablePair, immutableVector, inport, javaExceptionToString, javaWrap, justify, length, liMessage, liMessage, liMessage, liMessage, liMessage, liMessage, liMessage, list, list, list, list, list, makeURL, mapcar, memq, nlib, num, outport, pair, pairToExpressions, pairToExpVect, pairToValues, proc, read, registerBundle, reverse, reverseInPlace, simpleErrorToString, sourceAnnotations, str, string, sym, symbol, symval, truePair, truth, truth, typeError, typeError, updateName, url, url, url, valArrayToList, valArrayToList, valArrayToVec, vec, warn, warn, warn
public SymbolicEnvironment symenv
public SymbolicEnvironment toplevel_env
public AppContext()
public AppContext(java.util.Properties props)
props
- Properties which govern the
underlying Scheme environment.public AppContext(SymbolicEnvironment symenv)
symenv
- the global environmentpublic Expression getExpression(Symbol name)
public void loadEnv(SeekableDataInputStream i) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void saveEnv(java.io.OutputStream o, LibraryBuilder lb) throws java.io.IOException
java.io.IOException
public SymbolicEnvironment lookupContextEnv(Symbol s)
public void defineContextEnv(Symbol s, SymbolicEnvironment env)
public java.lang.String getProperty(java.lang.String name)
public java.lang.String getProperty(java.lang.String name, java.lang.String def)
public Expression resolveBinding(LibraryBinding lb) throws java.io.IOException
java.io.IOException
public LibraryBinding lookupBinding(Expression e) throws java.io.IOException
java.io.IOException
public boolean addHeap(SeekableInputStream in) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void addDefaultHeap() throws java.io.IOException
java.io.IOException
findHeap(URL)
public static SeekableInputStream openHeap(java.net.URL u) throws java.io.IOException
java.io.IOException
public static java.net.URL findHeap(java.net.URL heapLocation)
heapLocation
- The URL for the heap file. When
this is null it defaults to the value of the
sisc.heap system property and, if that is not present,
"sisc.shp"