Got rid of 'ensure-ps-symbol' internal function (at this point all it was doing was...
authorVladimir Sedach <vsedach@gmail.com>
Mon, 13 Apr 2009 20:05:10 +0000 (14:05 -0600)
committerVladimir Sedach <vsedach@gmail.com>
Mon, 13 Apr 2009 20:05:10 +0000 (14:05 -0600)
src/compiler.lisp
src/namespace.lisp
src/special-forms.lisp

index e17b0ad..ded6432 100644 (file)
@@ -229,7 +229,7 @@ the form cannot be compiled to a symbol."
         (t `(js:variable ,symbol))))
 
 (defun ps-convert-op-name (op)
-  (case (ensure-ps-symbol op)
+  (case op
     (and '\&\&)
     (or '\|\|)
     (not '!)
index 4a7a90b..dfeba9d 100644 (file)
@@ -1,13 +1,8 @@
+(in-package "PARENSCRIPT")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; ParenScript namespace system
 
-(in-package :parenscript)
-
-(defun ensure-ps-symbol (symbol)
-  (if (eq (symbol-package symbol) #.(find-package :parenscript))
-      symbol
-      (intern (symbol-name symbol) #.(find-package :parenscript))))
-
 ;;; Symbol obfuscation
 (defvar *obfuscated-packages* (make-hash-table))
 
index f7e8304..df4ebd3 100644 (file)
 (define-ps-special-form switch (test-expr &rest clauses)
   `(js:switch ,(compile-parenscript-form test-expr :expecting :expression)
      ,(loop for (val . body) in clauses collect
-           (cons (if (and (symbolp val) (eq (ensure-ps-symbol val) 'default))
+           (cons (if (eq val 'default)
                      'default
                      (compile-parenscript-form val :expecting :expression))
                  (mapcar (lambda (x) (compile-parenscript-form x :expecting :statement))
@@ -322,7 +322,7 @@ lambda-list::=
   [&aux {var | (var [init-form])}*])"
   (if (symbolp name)
       `(defun-function ,name ,lambda-list ,@body)
-      (progn (assert (and (= (length name) 2) (eq 'setf (ensure-ps-symbol (car name)))) ()
+      (progn (assert (and (listp name) (= (length name) 2) (eq 'setf (car name))) ()
                      "(defun ~s ~s ...) needs to have a symbol or (setf symbol) for a name." name lambda-list)
              `(defun-setf ,name ,lambda-list ,@body))))