[racket] Generating comparable symbols

From: Marco Morazan (morazanm at gmail.com)
Date: Wed Jan 15 08:20:59 EST 2014

Thank you Eric & Pierpaolo. I do, indeed, mean interned symbols, thus,
gensym is not what I want. I thought I was just unable to find the Racket
function for this, but apparently it really does not exist.

Marco
On Jan 15, 2014 2:59 AM, "Pierpaolo Bernardi" <olopierpa at gmail.com> wrote:

> On Wed, Jan 15, 2014 at 8:43 AM, Eric Dobson <eric.n.dobson at gmail.com>
> wrote:
> > I'm not sure what you mean by random, but does gensym do what you want?
>
> I think Marco means interned. Gensym produces uninterned symbols.
>
> AFAIK, and checking briefly the manual, there doesn't seem to exists a
> single function to do this.
> But it is easy to cobble up something.
>
> (define gensym-intern
>   (let ((k 0))
>     (λ ((base "gensym-"))
>       (set! k (add1 k))
>       (string->symbol (format "~a~a" base k)))))
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140115/01c56737/attachment.html>

Posted on the users mailing list.