Fixed handling of uninterned symbols.
authorVladimir Sedach <vsedach@gmail.com>
Fri, 3 Aug 2007 02:01:33 +0000 (02:01 +0000)
committerVladimir Sedach <vsedach@gmail.com>
Fri, 3 Aug 2007 02:01:33 +0000 (02:01 +0000)
src/builtin-packages.lisp
src/parser.lisp

index 849ccd8..357c552 100644 (file)
@@ -46,4 +46,7 @@
     :nicknames '("PS-USER" "PAREN-USER"))
    (create-script-package
     comp-env
-    :name "PS_GS" :lisp-package :parenscript.ps-gensyms)))
\ No newline at end of file
+    :name "PS_GS" :lisp-package :parenscript.ps-gensyms)
+   (create-script-package
+    comp-env
+    :name "UNINTERNED" :prefix "")))
\ No newline at end of file
index 34b63f5..4a89ed5 100644 (file)
@@ -105,7 +105,7 @@ don't have an associated ParenScript package.")
 Defaulting to :parenscript-user."
                          :format-arguments (list symbol (symbol-package symbol))))
                  (find-script-package "PARENSCRIPT-USER" (make-basic-compilation-environment))))
-      (gethash symbol (symbol-to-script-package *compilation-environment*))))
+      (find-script-package "UNINTERNED" *compilation-environment*)))
 
 (defun find-script-package (name &optional (comp-env *compilation-environment*))
   "Find the script package with the name NAME in the given compilation environment."
@@ -663,10 +663,12 @@ also guarantees that the symbol has an associated script-package."
       (setf res (ps-js::value res)))
     (assert (symbolp res) ()
             "~a is expected to be a symbol, but compiles to ~a (the ParenScript output for ~a alone is \"~a\"). This could be due to ~a being a special form." form res form (ps::ps* form) form)
-    (assert (symbol-script-package res) ()
-            "The symbol ~A::~A has no associated script package." 
-            (if (symbol-package res) (package-name (symbol-package res)) "ANONYMOUS-PACKAGE")
-            res)
+    (unless (symbol-script-package res)
+      (when *warn-ps-package*
+        (warn 'simple-style-warning
+              :format-control "The symbol ~A::~A has no associated script package."
+              :format-arguments (list (if (symbol-package res) (package-name (symbol-package res)) "ANONYMOUS-PACKAGE")
+                                      res))))
     res))
 
 (defun compile-to-statement (form)