From: Vladimir Sedach Date: Mon, 13 Apr 2009 20:05:10 +0000 (-0600) Subject: Got rid of 'ensure-ps-symbol' internal function (at this point all it was doing was... X-Git-Url: https://git.hcoop.net/clinton/parenscript.git/commitdiff_plain/b39a6394ce82020e88d34cf72d64ff257b9917b4 Got rid of 'ensure-ps-symbol' internal function (at this point all it was doing was polluting the PS package). --- diff --git a/src/compiler.lisp b/src/compiler.lisp index e17b0ad..ded6432 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -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 '!) diff --git a/src/namespace.lisp b/src/namespace.lisp index 4a7a90b..dfeba9d 100644 --- a/src/namespace.lisp +++ b/src/namespace.lisp @@ -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)) diff --git a/src/special-forms.lisp b/src/special-forms.lisp index f7e8304..df4ebd3 100644 --- a/src/special-forms.lisp +++ b/src/special-forms.lisp @@ -166,7 +166,7 @@ (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))))