gensym: Don't restrict numerical argument to fixnum.
authorStas Boukarev <stassats@gmail.com>
Wed, 23 May 2012 06:01:03 +0000 (10:01 +0400)
committerStas Boukarev <stassats@gmail.com>
Wed, 23 May 2012 06:01:03 +0000 (10:01 +0400)
(gensym number) was restricted to fixnums, restrict it to
unsigned-byte, as per the standard.

src/code/symbol.lisp
tests/symbol.pure.lisp

index 6210a6d..7031776 100644 (file)
@@ -274,7 +274,7 @@ distinct from the global value. Can also be SETF."
     (multiple-value-bind (prefix int)
         (etypecase thing
           (simple-string (values thing old))
-          (fixnum (values "G" thing))
+          (unsigned-byte (values "G" thing))
           (string (values (coerce thing 'simple-string) old)))
       (declare (simple-string prefix))
       (make-symbol (%make-symbol-name prefix int)))))
index ac30c8a..f5f9440 100644 (file)
@@ -25,3 +25,6 @@
     (set-pprint-dispatch 'string
                          (lambda (stream obj) (write-string "BAR-" stream)))
     (assert (string= "FOO-" (gentemp "FOO-") :end2 4))))
+
+(with-test (:name (gensym-fixnum-restriction))
+  (gensym (1+ most-positive-fixnum)))