HCoop
/
clinton
/
parenscript.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented LET and LET* by variable renaming, which provides the
[clinton/parenscript.git]
/
src
/
compiler.lisp
diff --git
a/src/compiler.lisp
b/src/compiler.lisp
index
2281ab3
..
0cc8dc7
100644
(file)
--- a/
src/compiler.lisp
+++ b/
src/compiler.lisp
@@
-52,6
+52,9
@@
lexical block.")
(defvar *ps-special-variables* ())
(defvar *ps-special-variables* ())
+(defun ps-special-variable-p (sym)
+ (member sym *ps-special-variables*))
+
;;; form predicates
(defun op-form-p (form)
;;; form predicates
(defun op-form-p (form)
@@
-273,7
+276,10
@@
the form cannot be compiled to a symbol."
(defvar *ps-gensym-counter* 0)
(defun ps-gensym (&optional (prefix "_js"))
(defvar *ps-gensym-counter* 0)
(defun ps-gensym (&optional (prefix "_js"))
- (make-symbol (format nil "~A~A" prefix (incf *ps-gensym-counter*))))
+ (let ((prefix (if (stringp prefix) prefix (symbol-to-js-string prefix nil))))
+ (make-symbol (format nil "~A~:[~;_~]~A" prefix
+ (digit-char-p (char prefix (1- (length prefix))))
+ (incf *ps-gensym-counter*)))))
(defmacro with-ps-gensyms (symbols &body body)
"Evaluate BODY with SYMBOLS bound to unique ParenScript identifiers.
(defmacro with-ps-gensyms (symbols &body body)
"Evaluate BODY with SYMBOLS bound to unique ParenScript identifiers.