Re: Is there something wrong with random function?

[email protected] (Don Cohen) Thu, 16 Nov 2017 18:19:56 +0000
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
 > > > On 16 Nov 2017, at 14:16, <[email protected]> <[email protected]> wrote:
 > > > Don already found the bug, but nobody commented about style.

I hadn't commented on this because it was not clear what you were 
really trying to do.
I suspected, but was not willing to assume, that you wanted to 
generate random 6 decimal digit numbers.
I think the intent of the remark was that instead of generating 
6 decimal digits separately you should just call (random 1000000),
and if you want leading zeros, then format the output as "~6,'0,d".
Or if you don't need the ones that start with zero you could do
 (+ 100000 (random 900000))

 > I have just modified it little so that I can get 6
 > digits, as I actually just need a string of
 > digits to construct web slugs with strings and
 > avoid having same slugs.

I still don't think I understand your intent.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list