git » jacl.git » commit 4df32ed

fix gensym

author Alan Dipert
2020-02-23 21:08:30 UTC
committer Alan Dipert
2020-02-23 21:08:30 UTC
parent d797aaef3280e6f6de24da12b765a34b1f48f2a2

fix gensym

boot.lisp +5 -5

diff --git a/boot.lisp b/boot.lisp
index 04f0019..2df34a6 100644
--- a/boot.lisp
+++ b/boot.lisp
@@ -138,18 +138,18 @@
 
 (%export 'gensym)
 (defun gensym (&optional (x nil x?))
-  (cond ((stringp x)
+  (cond ((and x? (stringp x))
          (jacl:%new (jacl:%js "LispSymbol")
                     (jacl:%js "~{}+~{}.toString()" x *gensym-counter*)))
-        ((numberp x)
+        ((and x? (numberp x))
          (jacl:%new (jacl:%js "LispSymbol")
                     (jacl:%js "'G'+~{}.toString()" x)))
-        ((not x?)
+        (x? (%type-error "string or integer"))
+        (t
          (let ((sym (jacl:%new (jacl:%js "LispSymbol")
                                (jacl:%js "'G'+~{}.toString()" *gensym-counter*))))
            (set '*gensym-counter* (1+ *gensym-counter*))
-           sym))
-        (t (%type-error "string or integer"))))
+           sym))))
 
 (%export 'or)
 (defmacro or (&rest forms)