Skip to content

Fix some problems in the package code

Helmut Eller requested to merge h.eller/Kawa:package-system-fixes into master

Handle KEYWORD and KAWA symbols in analogous ways, ie. when creating such symbols intern them in their normal Namespace and automatically export them from the LispPackage.

Currently this approach doesn't perform the usual conflict checks for the KAWA package. Undetected conflicts can occur when somebody uses (as in USE-PACKAGE) the KAWA package and symbols are created with eg. Symbol.valueOf. Apparently, the ANSI CL spec forbids the KEYWORD package in USE-PACKAGE; we could do the same for the KAWA package to avoid the problem.

  • gnu/commonlisp/testsuite/lang-test.lisp: Add tests to ensure that newly created Keywords and Kawa symbols are automatically exported from the LispPackage and inserted their Namespace.

  • gnu/kawa/lispexpr/LispPackage.java (KeywordNamespace): Set Keyword.keywordNamespace as the exported namespace, analogous to EmptyNamespace and KAWA package. (createSymbol): New helper. (makeUninternedSymbol): Deleted.

  • gnu/commonlisp/lisp/primitives.lisp (find-symbol) (multiple-value-list, nth-value): New. Needed for testing.

  • gnu/commonlisp/lang/CommonLisp.java (initLisp): Add bindings for find-symbol, multiple-value-list, and nth-value.

Merge request reports