;; This function is used internally to initialize the CL package
;; with the symbols built during bootstrap.
(defun %intern-symbol (symbol)
- (let ((symbols (%package-symbols *common-lisp-package*)))
- (oset symbol "package" *common-lisp-package*)
+ (let* ((package
+ (if (in "package" symbol)
+ (find-package-or-fail (oget symbol "package"))
+ *common-lisp-package*))
+ (symbols (%package-symbols *common-lisp-package*)))
+ (oset symbol "package" package)
(oset symbols (symbol-name symbol) symbol)))
(defun find-symbol (name &optional (package *package*))
(let* ((package (find-package-or-fail package))
(symbols (%package-symbols package)))
(if (in name symbols)
- (values (oget symbols name) t)
+ (values (oget symbols name) :interned)
(dolist (used (package-use-list package) (values nil nil))
(let ((exports (%package-external-symbols used)))
(when (in name exports)
((symbolp sexp)
(or (cdr (assoc sexp *literal-symbols*))
(let ((v (genlit))
- (s #+common-lisp (concat "{name: \"" (escape-string (symbol-name sexp)) "\"}")
- #+ecmalisp
- (let ((package (symbol-package sexp)))
- (if (null package)
- (concat "{name: \"" (escape-string (symbol-name sexp)) "\"}")
- (ls-compile `(intern ,(symbol-name sexp) ,(package-name package)))))))
+ (s #+common-lisp
+ (let ((package (symbol-package sexp)))
+ (if (eq package (find-package "KEYWORD"))
+ (concat "{name: \"" (escape-string (symbol-name sexp))
+ "\", package: '" (package-name package) "'}")
+ (concat "{name: \"" (escape-string (symbol-name sexp)) "\"}")))
+ #+ecmalisp
+ (let ((package (symbol-package sexp)))
+ (if (null package)
+ (concat "{name: \"" (escape-string (symbol-name sexp)) "\"}")
+ (ls-compile `(intern ,(symbol-name sexp) ,(package-name package)))))))
(push (cons sexp v) *literal-symbols*)
(toplevel-compilation (concat "var " v " = " s))
v)))