[racket] Generating comparable symbols
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)))))