On Sep 9, 2009, at 5:42 PM, Brian Mastenbrook wrote:
>> (gensym)
> #{g0 f3s6pdjhhzxupwds-a}
>> (define gensyms-readable
> (lambda ()
> (let ((g (gensym))
> (p (open-output-string)))
> (write g p)
> (let ((r (open-input-string (get-output-string p))))
> (eq? (read r) g)))))
>> (gensyms-readable)
> #t
>
> The actual requirement for the use of gensyms in this situation is
> that a gensym must not be eq? to any other symbol which already
> exists.
Having read/write invariant on gensyms has nothing to do with whether
a call to gensym returns a fresh symbol or not (the reader does not
have to call gensym when it reads #{foo bar}, instead, it may consult
the "gensym table" first).
A good way to think of Chez's/Ikarus's gensyms is that they're like
UUIDs: you can make as many of them as you need, and they're very
unlikely to match with other UUIDs, but you can still type them in
and read them back.
And don't use gensyms for cryptographic purposes. [there was at least
one web site that had security issues due to the host system generating
gensyms in some predictable sequence and the web application relying on
it as a source of randomness].
Aziz,,,
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss