Lisp HUG Maillist Archive

Strange gensym behavior

This is on Win32/LW5

 

Am I misunderstanding gensym?  With higher numbers, I am not consistently getting a symbol with a preceding non-numeric (default of G).

 

 

See below:

 

 

CL-USER 32 > (let ((*gensym-counter* 9999999999999)) (gensym))

#:G9999999999999

 

CL-USER 33 > (let ((*gensym-counter* 100000000)) (gensym))

#:|100000000|

 

CL-USER 40 > (let ((*gensym-counter* 600000000)) (gensym))

#:G600000000

 

CL-USER 41 > (let ((*gensym-counter* 500000000)) (gensym))

#:|500000000|

 

CL-USER 42 > (let ((*gensym-counter* 500000000)) (gensym "X"))

#:|500000000|

 

 

Re: Strange gensym behavior

On Tue, Dec 11, 2007 at 09:29:33AM -0600, Matt.Lamari wrote:
> This is on Win32/LW5
> 
> Am I misunderstanding gensym?  With higher numbers, I am not
> consistently getting a symbol with a preceding non-numeric (default
> of G).
> 
> See below:
> 
> CL-USER 33 > (let ((*gensym-counter* 100000000)) (gensym))
> 
> #:|100000000|

a) And you're doing this why, again?
b) They still work:

   CL-USER 4 > (pprint (let* ((*gensym-counter* 100000000) (s (gensym))) `(let ((,s 10)) ,s)))

   (LET ((#:|100000000| 10)) #:|100000000|)

   CL-USER 5 > (eval (let* ((*gensym-counter* 100000000) (s (gensym))) `(let ((,s 10)) ,s)))
   10

(LWL 5.0.2)

-- L


RE: Strange gensym behavior

I think this is a bug in the function SYSTEM::COUNT-POSITIVE-FIXNUM-DECIMAL-DIGITS, which doesn’t get the answer correct for some fixnums that are bigger than 99999999 – this function is used in the implementation of gensym. It miscalculates the length of the printed form of the number.

 

 

From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Matt.Lamari
Sent: 11 December 2007 15:30
To: lisp-hug@lispworks.com
Subject: Strange gensym behavior

 

This is on Win32/LW5

 

Am I misunderstanding gensym?  With higher numbers, I am not consistently getting a symbol with a preceding non-numeric (default of G).

 

 

See below:

 

 

CL-USER 32 > (let ((*gensym-counter* 9999999999999)) (gensym))

#:G9999999999999

 

CL-USER 33 > (let ((*gensym-counter* 100000000)) (gensym))

#:|100000000|

 

CL-USER 40 > (let ((*gensym-counter* 600000000)) (gensym))

#:G600000000

 

CL-USER 41 > (let ((*gensym-counter* 500000000)) (gensym))

#:|500000000|

 

CL-USER 42 > (let ((*gensym-counter* 500000000)) (gensym "X"))

#:|500000000|

 

 

Re: Strange gensym behavior

Unable to parse email body. Email id is 7304

Updated at: 2020-12-10 08:44 UTC