From: David Vázquez Date: Wed, 8 May 2013 08:27:07 +0000 (+0100) Subject: Fix keyword dumping and restoring X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=0b4243f0737c5aa7148b0bb5506276a897f15c32;p=jscl.git Fix keyword dumping and restoring --- 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))