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 LispPackage
static final LispPackage
static ThreadLocation
<LispPackage> Common Lisp*package*
special.The set of exported symbols.static final LispPackage
static final LispPackage
Fields inherited from class gnu.mapping.Namespace
EmptyNamespace, nsTable, prefix, UNKNOWN_NAMESPACE
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addNickNames
(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 void
exportPkg
(LList syms, LispPackage pkg) Export a list of symbols from a package, checking for conflicts.static LispPackage
findPackage
(String name) Returns null if no package exists.findSymbol
(Object name) static void
importPkg
(LList syms, LispPackage pkg) Import a list of symbols into the internal table of a package.static Object
intern
(String name, LispPackage pkg) boolean
static boolean
lookupPresent
(String name, int hash, boolean intern) static LispPackage
makeLispPackage
(Object name, LList nicks, LList used) static LList
Used for the CL PACKAGE-USED-BY-LIST functionstatic LList
Used for the CL PACKAGE-USE-LIST function.void
void
The core of the Common Lisp shadow function.void
shadowingImport
(Symbol symbol) static void
Temporary stub until Kawa supports conditional restarts.static Object
boolean
static void
use
(LispPackage importing, LispPackage imported) static void
usePackages
(LList importees, LispPackage importer) static LispPackage
Look up a given package in theNamespace
map.static Namespace
valueOfNoCreate
(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, writeExternal
Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, getNode, getOrDefault, hash, hashToIndex, matches, matches, put, put, rehash, remove, size
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 theNamespace
map. 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
LispPackage
named byname
ornull
if aNamespace
is already named byname
but 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.
-