From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rain1@openmailbox.org Newsgroups: gmane.lisp.guile.bugs Subject: bug#20087: gensym Date: Fri, 18 Mar 2016 17:03:27 +0000 Message-ID: References: <87a8zjxxpl.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_22828f8a7bb09d47194f8199789c9720" X-Trace: ger.gmane.org 1458324623 19910 80.91.229.3 (18 Mar 2016 18:10:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 18:10:23 +0000 (UTC) To: 20087@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 18 19:10: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 1agyqi-00024u-Cq for guile-bugs@m.gmane.org; Fri, 18 Mar 2016 19:10:12 +0100 Original-Received: from localhost ([::1]:45475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agyqh-0006us-Hx for guile-bugs@m.gmane.org; Fri, 18 Mar 2016 14:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agyqc-0006pZ-Mv for bug-guile@gnu.org; Fri, 18 Mar 2016 14:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agyqY-0004P3-Hm for bug-guile@gnu.org; Fri, 18 Mar 2016 14:10:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agyqY-0004Oq-CK for bug-guile@gnu.org; Fri, 18 Mar 2016 14:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1agyqY-0007hl-9B for bug-guile@gnu.org; Fri, 18 Mar 2016 14:10:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87a8zjxxpl.fsf@gnu.org> Resent-From: rain1@openmailbox.org Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 18 Mar 2016 18:10:02 +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.145832458729562 (code B ref 20087); Fri, 18 Mar 2016 18:10:02 +0000 Original-Received: (at 20087) by debbugs.gnu.org; 18 Mar 2016 18:09:47 +0000 Original-Received: from localhost ([127.0.0.1]:52926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agyqJ-0007gk-5g for submit@debbugs.gnu.org; Fri, 18 Mar 2016 14:09:47 -0400 Original-Received: from mail2.openmailbox.org ([62.4.1.33]:52559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agxoA-00064J-Fj for 20087@debbugs.gnu.org; Fri, 18 Mar 2016 13:03:30 -0400 Original-Received: by mail2.openmailbox.org (Postfix, from userid 1004) id AA7152ACA037; Fri, 18 Mar 2016 18:03:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1458320609; bh=dWVvuftrCjpWsqOJFV46BsrHlgLnJxG0oisTokn+nJU=; h=Date:From:To:Subject:From; b=JaJuN18Ucv2LcLY6YcFQoac9X7dYGJst4hmKuZzLdGkoYMxIbbyxOmpKjz2oYmPDp LSb16mpcFi/4WNuhrN11XUnqAZUqbr/D8Fq9AQ+3ZCKha+jBIqcGQW6KyJ4tCPXoMn cMFUXtGRUQrDIILi1e6XtlvzFYlrN3nq8R6NcO1w= Original-Received: from www.openmailbox.org (openmailbox-b1 [10.91.69.218]) by mail2.openmailbox.org (Postfix) with ESMTP id 743D32AC6E69 for <20087@debbugs.gnu.org>; Fri, 18 Mar 2016 18:03:28 +0100 (CET) X-Sender: rain1@openmailbox.org User-Agent: Roundcube Webmail/1.0.6 X-Mailman-Approved-At: Fri, 18 Mar 2016 14:09:45 -0400 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:7990 Archived-At: --=_22828f8a7bb09d47194f8199789c9720 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello I agree, this goes against the main assumption people have about gensym. I was able to reproduce the bug. Here's a patch to libguile/symbol.c which fixes this behavior by incrementing the gensym counter in a loop until it creates a fresh symbol. --=_22828f8a7bb09d47194f8199789c9720 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=guile-gensym-fix.diff Content-Disposition: attachment; filename=guile-gensym-fix.diff; size=1396 ZGlmZiAtLWdpdCBhL2xpYmd1aWxlL3N5bWJvbHMuYyBiL2xpYmd1aWxlL3N5bWJvbHMuYwppbmRl eCA3MWQ5ODI3Li4yZGY3NDMzIDEwMDY0NAotLS0gYS9saWJndWlsZS9zeW1ib2xzLmMKKysrIGIv bGliZ3VpbGUvc3ltYm9scy5jCkBAIC0zOTQsMTkgKzM5NCwzMSBAQCBTQ01fREVGSU5FIChzY21f Z2Vuc3ltLCAiZ2Vuc3ltIiwgMCwgMSwgMCwKICAgU0NNIHN1ZmZpeCwgbmFtZTsKICAgaW50IG4s IG5fZGl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mcm9tX2xhdGluMV9zdHJpbmduIChidWYsIG5fZGln aXRzKTsKKyAgICBuYW1lID0gc2NtX3N0cmluZ19hcHBlbmQgKHNjbV9saXN0XzIgKHByZWZpeCwg c3VmZml4KSk7CisgICAgCisgICAgc3ltYm9sID0gbG9va3VwX2ludGVybmVkX3N5bWJvbCAobmFt ZSwgc2NtX2lfc3RyaW5nX2hhc2ggKG5hbWUpKTsKKyAgICBpZiAoc2NtX2lzX3RydWUgKHN5bWJv bCkpCisgICAgICB7CisgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorICAgIGVsc2UKKyAgICAg IHsKKyAgICAgICAgcmV0dXJuIHNjbV9zdHJpbmdfdG9fc3ltYm9sIChuYW1lKTsKKyAgICAgIH0K KyAgfQogfQogI3VuZGVmIEZVTkNfTkFNRQogCg== --=_22828f8a7bb09d47194f8199789c9720--