From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#20087: gensym Date: Wed, 23 Mar 2016 13:55:13 -0400 Message-ID: <87twjxqdtq.fsf@netris.org> References: <87a8zjxxpl.fsf@gnu.org> <87twjzytit.fsf@netris.org> <87wpovueos.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1458755784 2083 80.91.229.3 (23 Mar 2016 17:56:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2016 17:56:24 +0000 (UTC) Cc: rain1@openmailbox.org, 20087@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Mar 23 18:56:13 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ain0u-0001Nr-MU for guile-bugs@m.gmane.org; Wed, 23 Mar 2016 18:56:12 +0100 Original-Received: from localhost ([::1]:45290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ain0r-0004AT-1J for guile-bugs@m.gmane.org; Wed, 23 Mar 2016 13:56:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ain0n-0004AE-F7 for bug-guile@gnu.org; Wed, 23 Mar 2016 13:56:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ain0k-00070M-8Y for bug-guile@gnu.org; Wed, 23 Mar 2016 13:56:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ain0k-00070H-4r for bug-guile@gnu.org; Wed, 23 Mar 2016 13:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ain0j-0005mI-Qx for bug-guile@gnu.org; Wed, 23 Mar 2016 13:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 23 Mar 2016 17:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20087 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 20087-submit@debbugs.gnu.org id=B20087.145875572422163 (code B ref 20087); Wed, 23 Mar 2016 17:56:01 +0000 Original-Received: (at 20087) by debbugs.gnu.org; 23 Mar 2016 17:55:24 +0000 Original-Received: from localhost ([127.0.0.1]:34691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ain08-0005lP-79 for submit@debbugs.gnu.org; Wed, 23 Mar 2016 13:55:24 -0400 Original-Received: from world.peace.net ([50.252.239.5]:57847 ident=hope9) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ain06-0005lH-TS for 20087@debbugs.gnu.org; Wed, 23 Mar 2016 13:55:23 -0400 Original-Received: from [10.1.10.78] (helo=jojen) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aimzz-0008EH-DJ; Wed, 23 Mar 2016 13:55:15 -0400 In-Reply-To: <87wpovueos.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 22 Mar 2016 08:58:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7996 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mark H Weaver 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=E2=80=99m 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") =3D> #{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 =E2=80=98gens= ym=E2=80=99 entry, which I think is sufficient. The symbols generated by =E2=80=98gensym=E2=80=99 are _likely_ to be u= nique, 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=E2=80=99t be usefully written= out and read back in. What do you think? Mark