From 0b4243f0737c5aa7148b0bb5506276a897f15c32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Wed, 8 May 2013 09:27:07 +0100 Subject: [PATCH] Fix keyword dumping and restoring --- src/compiler.lisp | 5 +++-- src/package.lisp | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index cfe7020..1f6668f 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -527,8 +527,7 @@ #+common-lisp (let ((package (symbol-package symbol))) (if (eq package (find-package "KEYWORD")) - (code "(new Symbol(" (dump-string (symbol-name symbol)) ", " - (dump-string (package-name package)) "))") + (code "(new Symbol(" (dump-string (symbol-name symbol)) ", " (dump-string (package-name package)) "))") (code "(new Symbol(" (dump-string (symbol-name symbol)) "))"))) #+jscl (let ((package (symbol-package symbol))) @@ -577,6 +576,8 @@ (let ((jsvar (genlit))) (push (cons sexp jsvar) *literal-table*) (toplevel-compilation (code "var " jsvar " = " dumped)) + (when (keywordp sexp) + (toplevel-compilation (code jsvar ".value = " jsvar))) jsvar))))))) diff --git a/src/package.lisp b/src/package.lisp index b16e9bb..d3861e8 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -84,11 +84,14 @@ (if (in "package" symbol) (find-package-or-fail (oget symbol "package")) *common-lisp-package*)) - (symbols (%package-symbols package))) + (symbols (%package-symbols package)) + (exports (%package-external-symbols package))) (oset symbol "package" package) + (oset symbols (symbol-name symbol) symbol) + ;; Turn keywords self-evaluated and export them. (when (eq package *keyword-package*) - (oset symbol "value" symbol)) - (oset symbols (symbol-name symbol) symbol))) + (oset symbol "value" symbol) + (oset exports (symbol-name symbol) symbol)))) (defun find-symbol (name &optional (package *package*)) (let* ((package (find-package-or-fail package)) -- 1.7.10.4