From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: rain1@openmailbox.org, 20087@debbugs.gnu.org
Subject: bug#20087: gensym
Date: Thu, 24 Mar 2016 09:45:38 +0100 [thread overview]
Message-ID: <87r3f04631.fsf@gnu.org> (raw)
In-Reply-To: <87twjxqdtq.fsf@netris.org> (Mark H. Weaver's message of "Wed, 23 Mar 2016 13:55:13 -0400")
Mark H Weaver <mhw@netris.org> skribis:
> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Mark H Weaver <mhw@netris.org> skribis:
>>
>>> If we cannot eliminate the possibility of collisions, and we cannot
>>> avoid intentional collisions, what can we do? I think the best we can
>>> hope for is to significantly reduce the probability of _unintentional_
>>> collisions, perhaps by starting the gensym counter at a large number.
>>
>> I’m not sure if that would help.
>>
>> One thing that could help avoid unintentional collisions is to
>> automatically add whitespace before the number, such that:
>>
>> (gensym "x") => #{x 123}#
>
> I think this is a good idea.
>
>>> The other thing we can do is to clearly document these inherent problems
>>> with gensym, so that they will not be misused for jobs for which they
>>> are not appropriate.
>>
>> I think we should add a sentence to that effect in the manual.
>
> It turns out the manual already has the following text in the ‘gensym’
> entry, which I think is sufficient.
>
> The symbols generated by ‘gensym’ are _likely_ to be unique, since
> their names begin with a space and it is only otherwise possible to
> generate such symbols if a programmer goes out of their way to do so.
> Uniqueness can be guaranteed by instead using uninterned symbols
> (*noteSymbol Uninterned::), though they can’t be usefully written out
> and read back in.
>
> What do you think?
Oh indeed, I guess I had overlooked that.
Ludo’.
next prev parent reply other threads:[~2016-03-24 8:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 17:15 bug#20087: 'gensym' is not guaranteed to return a fresh symbol Ludovic Courtès
2016-03-18 17:03 ` bug#20087: gensym rain1
2016-03-22 5:24 ` Mark H Weaver
2016-03-22 7:58 ` Ludovic Courtès
2016-03-23 17:55 ` Mark H Weaver
2016-03-24 8:45 ` Ludovic Courtès [this message]
2016-06-23 13:48 ` Andy Wingo
2016-06-23 14:13 ` Ludovic Courtès
2016-06-23 16:05 ` Andy Wingo
2016-03-22 11:21 ` rain1
2016-03-22 18:06 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r3f04631.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=20087@debbugs.gnu.org \
--cc=mhw@netris.org \
--cc=rain1@openmailbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).