Class LispPackage

All Implemented Interfaces:
HasNamedParts, Externalizable, Serializable, Map<String,Symbol>

public class LispPackage extends Namespace
Implement a Common Lisp "package" value.
See Also:
  • Field Details

    • exported

      public Namespace exported
      The set of exported symbols. This is one of the packages in importing.
    • CLNamespace

      public static final LispPackage CLNamespace
    • KeywordNamespace

      public static final LispPackage KeywordNamespace
    • KawaNamespace

      public static final LispPackage KawaNamespace
    • ClassNamespace

      public static final LispPackage ClassNamespace
    • currentPackage

      public static ThreadLocation<LispPackage> currentPackage
      Common Lisp *package* special.
  • Constructor Details

    • LispPackage

      public LispPackage()
  • Method Details

    • setExportedNamespace

      public void setExportedNamespace(Namespace exp)
    • getShadowingSymbols

      public LList getShadowingSymbols()
    • pkgUsesList

      public static LList pkgUsesList(LispPackage lp)
      Used for the CL PACKAGE-USE-LIST function.
    • pkgUsedByList

      public static LList pkgUsedByList(LispPackage lp)
      Used for the CL PACKAGE-USED-BY-LIST function
    • addNickNames

      public static void addNickNames(LispPackage name, LList nicks)
    • usePackages

      public static void usePackages(LList importees, LispPackage importer)
    • makeLispPackage

      public static LispPackage makeLispPackage(Object name, LList nicks, LList used)
    • valueOf

      public static LispPackage valueOf(String name)
      Look up a given package in the Namespace 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 by name or null if a Namespace is already named by name but is not a lisp package.
    • valueOfNoCreate

      public static Namespace valueOfNoCreate(String name)
    • findSymbol

      public Values.Values2 findSymbol(Object name)
    • exportPkg

      public static void exportPkg(LList syms, LispPackage pkg)
      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

      public static void importPkg(LList syms, LispPackage pkg)
      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

      public LList allSymbols(Namespace ns)
      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

      public LList allExternalSymbols()
      The list of symbols exported from this package.
      Returns:
      A list of the the exported symbols from the current package.
    • allInternalSymbols

      public LList allInternalSymbols()
      The list of symbols interned into this package.
      Returns:
      A list of the interned symbols in this package.
    • use

      public static void use(LispPackage importing, LispPackage imported)
    • lookup

      public Symbol lookup(String name, int hash, boolean create)
      Overrides:
      lookup in class Namespace
    • lookupPresent

      public Symbol lookupPresent(String name, int hash, boolean intern)
    • isPresent

      public boolean isPresent(String name)
    • unintern

      public boolean unintern(Symbol symbol)
    • shadow

      public void shadow(String name)
      The core of the Common Lisp shadow function.
    • shadowingImport

      public void shadowingImport(Symbol symbol)
    • keywordp

      public static boolean keywordp(Object x)
    • symbolPackage

      public static Object symbolPackage(Object x)
    • intern

      public static Object intern(String name, LispPackage pkg)
    • findPackage

      public static LispPackage findPackage(String name)
      Returns null if no package exists.
    • signal

      public static void signal(String msg)
      Temporary stub until Kawa supports conditional restarts.