gnu.commonlisp.lang
Class Lisp2

java.lang.Object
  extended by gnu.expr.Language
      extended by gnu.kawa.lispexpr.LispLanguage
          extended by gnu.commonlisp.lang.Lisp2
Direct Known Subclasses:
CommonLisp, ELisp

public abstract class Lisp2
extends LispLanguage

Abstract class for Lisp-like languages with separate namespaces.


Field Summary
static LList FALSE
           
static Expression nilExpr
           
static Symbol TRUE
           
 
Fields inherited from class gnu.kawa.lispexpr.LispLanguage
defaultReadTable, lookup_sym, quasiquote_sym, quote_sym, unquote_sym, unquotesplicing_sym
 
Fields inherited from class gnu.expr.Language
current, env_counter, environ, FUNCTION_NAMESPACE, NAMESPACE_PREFIX_NAMESPACE, PARSE_IMMEDIATE, PARSE_ONE_LINE, PARSE_PROLOG, requirePedantic, userEnv, VALUE_NAMESPACE
 
Constructor Summary
Lisp2()
           
 
Method Summary
static java.lang.Object asSymbol(java.lang.String name)
          Get a symbol for a given (interned) Java string.
 java.lang.Object booleanObject(boolean b)
           
 ReadTable createReadTable()
          Create a fresh ReadTable appropriate for this language.
protected  void defun(java.lang.String name, java.lang.Object value)
           
protected  void defun(Symbol sym, java.lang.Object value)
           
 void emitPushBoolean(boolean value, CodeAttr code)
           
protected  Symbol fromLangSymbol(java.lang.Object obj)
           
 java.lang.Object getEnvPropertyFor(java.lang.reflect.Field fld, java.lang.Object value)
           
 int getNamespaceOf(Declaration decl)
          Return the namespace (e.g value or function) of a Declaration.
static java.lang.Object getString(java.lang.String name)
          Get a string for a given Java string.
static java.lang.Object getString(Symbol symbol)
          Get a string for a given symbol.
 boolean hasSeparateFunctionNamespace()
          True if functions are in a separate anme space from variable.
protected  void importLocation(Location loc)
           
 boolean isTrue(java.lang.Object value)
          Test if a value is considered "true" in this language.
 java.lang.Object noValue()
          The value to return for a "void" result.
 boolean selfEvaluatingSymbol(java.lang.Object obj)
           
 
Methods inherited from class gnu.kawa.lispexpr.LispLanguage
declFromField, defSntxStFld, defSntxStFld, getCompilation, getLexer, langSymbolToSymbol, makeApply, makeBody, parse, resolve
 
Methods inherited from class gnu.expr.Language
asType, coerceFromObject, coerceToObject, coerceToObject, defAliasStFld, define, defineFunction, defineFunction, defProcStFld, defProcStFld, detect, detect, detect, emitCoerceToBoolean, eval, eval, eval, eval, eval, eval, eval, eval, eval, getDefaultLanguage, getEnvironment, getEnvPropertyFor, getFormat, getInstance, getInstance, getInstanceFromFilenameExtension, getLangEnvironment, getLangTypeFor, getLanguages, getName, getNewEnvironment, getOutputConsumer, getPrompter, getSymbol, getTypeFor, getTypeFor, getTypeFor, getTypeFor, getTypeFor, hasNamespace, loadClass, lookup, lookupBuiltin, parse, parse, parse, registerLanguage, runAsApplication, setDefaultLanguage, setDefaults, string2Type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FALSE

public static final LList FALSE

TRUE

public static final Symbol TRUE

nilExpr

public static final Expression nilExpr
Constructor Detail

Lisp2

public Lisp2()
Method Detail

isTrue

public boolean isTrue(java.lang.Object value)
Description copied from class: Language
Test if a value is considered "true" in this language.

Overrides:
isTrue in class Language

booleanObject

public java.lang.Object booleanObject(boolean b)
Overrides:
booleanObject in class Language

emitPushBoolean

public void emitPushBoolean(boolean value,
                            CodeAttr code)
Overrides:
emitPushBoolean in class Language

noValue

public java.lang.Object noValue()
Description copied from class: Language
The value to return for a "void" result.

Overrides:
noValue in class Language

hasSeparateFunctionNamespace

public boolean hasSeparateFunctionNamespace()
Description copied from class: Language
True if functions are in a separate anme space from variable. Is true for e.g. Common Lisp, Emacs Lisp; false for Scheme.

Overrides:
hasSeparateFunctionNamespace in class Language

selfEvaluatingSymbol

public boolean selfEvaluatingSymbol(java.lang.Object obj)
Overrides:
selfEvaluatingSymbol in class LispLanguage

getEnvPropertyFor

public java.lang.Object getEnvPropertyFor(java.lang.reflect.Field fld,
                                          java.lang.Object value)
Overrides:
getEnvPropertyFor in class Language

getNamespaceOf

public int getNamespaceOf(Declaration decl)
Description copied from class: Language
Return the namespace (e.g value or function) of a Declaration. Return a bitmask of all the namespaces "covered" by the Declaration. Note this isn't a namespace in the XML sense; if a Declaration has a specific namespace URI, then that is part of its symbol. This namespace bitmap is a separate dimension, for the use of languages that have separate namespaces for different kinds of declarations, such as variables and functions.

Overrides:
getNamespaceOf in class Language

asSymbol

public static java.lang.Object asSymbol(java.lang.String name)
Get a symbol for a given (interned) Java string.


fromLangSymbol

protected Symbol fromLangSymbol(java.lang.Object obj)
Overrides:
fromLangSymbol in class LispLanguage

getString

public static java.lang.Object getString(java.lang.String name)
Get a string for a given Java string.


getString

public static java.lang.Object getString(Symbol symbol)
Get a string for a given symbol.


defun

protected void defun(java.lang.String name,
                     java.lang.Object value)

defun

protected void defun(Symbol sym,
                     java.lang.Object value)

importLocation

protected void importLocation(Location loc)

createReadTable

public ReadTable createReadTable()
Description copied from class: LispLanguage
Create a fresh ReadTable appropriate for this language.

Specified by:
createReadTable in class LispLanguage