stassats | 23 May 2012 08:02
Picon

master: gensym: Don't restrict numerical argument to fixnum.

The branch "master" has been updated in SBCL:
       via  35f68f481cbea35889d2488c476cbc28898e82f4 (commit)
      from  9bc5da72887b15eb83500e16f05c3e42835476a3 (commit)

- Log -----------------------------------------------------------------
commit 35f68f481cbea35889d2488c476cbc28898e82f4
Author: Stas Boukarev <stassats <at> gmail.com>
Date:   Wed May 23 10:01:03 2012 +0400

    gensym: Don't restrict numerical argument to fixnum.

    (gensym number) was restricted to fixnums, restrict it to
    unsigned-byte, as per the standard.
---
 src/code/symbol.lisp   |    2 +-
 tests/symbol.pure.lisp |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/code/symbol.lisp b/src/code/symbol.lisp
index 6210a6d..7031776 100644
--- a/src/code/symbol.lisp
+++ b/src/code/symbol.lisp
 <at>  <at>  -274,7 +274,7  <at>  <at>  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)))))
diff --git a/tests/symbol.pure.lisp b/tests/symbol.pure.lisp
index ac30c8a..f5f9440 100644
--- a/tests/symbol.pure.lisp
+++ b/tests/symbol.pure.lisp
 <at>  <at>  -25,3 +25,6  <at>  <at> 
     (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)))

-----------------------------------------------------------------------

hooks/post-receive
--

-- 
SBCL

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane