Package gnu.kawa.lispexpr
Class LispPackage
java.lang.Object
java.util.AbstractMap<String,Symbol>
gnu.kawa.util.AbstractHashTable<gnu.mapping.SymbolRef,String,Symbol>
gnu.mapping.Namespace
gnu.kawa.lispexpr.LispPackage
- All Implemented Interfaces:
HasNamedParts,Externalizable,Serializable,Map<String,Symbol>
Implement a Common Lisp "package" value.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LispPackagestatic final LispPackagestatic ThreadLocation<LispPackage> Common Lisp*package*special.The set of exported symbols.static final LispPackagestatic final LispPackageFields inherited from class gnu.mapping.Namespace
EmptyNamespace, nsTable, prefix, UNKNOWN_NAMESPACEFields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNickNames(LispPackage name, LList nicks) The list of symbols exported from this package.The list of symbols interned into this package.allSymbols(Namespace ns) The list of symbols managed by a given namespace.static voidexportPkg(LList syms, LispPackage pkg) Export a list of symbols from a package, checking for conflicts.static LispPackagefindPackage(String name) Returns null if no package exists.findSymbol(Object name) static voidimportPkg(LList syms, LispPackage pkg) Import a list of symbols into the internal table of a package.static Objectintern(String name, LispPackage pkg) booleanstatic booleanlookupPresent(String name, int hash, boolean intern) static LispPackagemakeLispPackage(Object name, LList nicks, LList used) static LListUsed for the CL PACKAGE-USED-BY-LIST functionstatic LListUsed for the CL PACKAGE-USE-LIST function.voidvoidThe core of the Common Lisp shadow function.voidshadowingImport(Symbol symbol) static voidTemporary stub until Kawa supports conditional restarts.static Objectbooleanstatic voiduse(LispPackage importing, LispPackage imported) static voidusePackages(LList importees, LispPackage importer) static LispPackageLook up a given package in theNamespacemap.static NamespacevalueOfNoCreate(String name) Methods inherited from class gnu.mapping.Namespace
add, allocEntries, create, create, get, get, getDefault, getDefaultSymbol, getEntryHashCode, getEntryNext, getName, getPrefix, getSymbol, isConstant, isUnknownNamespace, lookup, lookupInternal, makeEntry, makeUnknownNamespace, readExternal, readResolve, remove, setEntryNext, setName, toString, valueOf, valueOf, valueOf, writeExternalMethods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, getNode, getOrDefault, hash, hashToIndex, matches, matches, put, put, rehash, remove, sizeMethods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
exported
The set of exported symbols. This is one of the packages in importing. -
CLNamespace
-
KeywordNamespace
-
KawaNamespace
-
ClassNamespace
-
currentPackage
Common Lisp*package*special.
-
-
Constructor Details
-
LispPackage
public LispPackage()
-
-
Method Details
-
setExportedNamespace
-
getShadowingSymbols
-
pkgUsesList
Used for the CL PACKAGE-USE-LIST function. -
pkgUsedByList
Used for the CL PACKAGE-USED-BY-LIST function -
addNickNames
-
usePackages
-
makeLispPackage
-
valueOf
Look up a given package in theNamespacemap. This method creates a new Lisp package in the namespace if it does not already exist.- Parameters:
name- The name of the package to look up.- Returns:
- The
LispPackagenamed bynameornullif aNamespaceis already named bynamebut is not a lisp package.
-
valueOfNoCreate
-
findSymbol
-
exportPkg
Export a list of symbols from a package, checking for conflicts.- Parameters:
syms- The list of symbols to export.pkg- The package to export the symbols from.
-
importPkg
Import a list of symbols into the internal table of a package. This method checks for conflicts, and should in the future allow the user to shadow import any conflicts.- Parameters:
syms- the list of symbols to import.pkg- the package to import into.
-
allSymbols
The list of symbols managed by a given namespace.- Parameters:
ns- The namespace whose symbol table we query- Returns:
- The list of symbols managed by the given namespace.
-
allExternalSymbols
The list of symbols exported from this package.- Returns:
- A list of the the exported symbols from the current package.
-
allInternalSymbols
The list of symbols interned into this package.- Returns:
- A list of the interned symbols in this package.
-
use
-
lookup
-
lookupPresent
-
isPresent
-
unintern
-
shadow
The core of the Common Lisp shadow function. -
shadowingImport
-
keywordp
-
symbolPackage
-
intern
-
findPackage
Returns null if no package exists. -
signal
Temporary stub until Kawa supports conditional restarts.
-