From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 18 19:13:15 2013 Received: (at submit) by debbugs.gnu.org; 18 Mar 2013 23:13:15 +0000 Received: from localhost ([127.0.0.1]:34282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHjEx-0002TF-4b for submit@debbugs.gnu.org; Mon, 18 Mar 2013 19:13:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47440) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHjEv-0002T8-3T for submit@debbugs.gnu.org; Mon, 18 Mar 2013 19:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHjDL-0008CQ-Ej for submit@debbugs.gnu.org; Mon, 18 Mar 2013 19:11:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:53648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHjDL-0008CG-Ax for submit@debbugs.gnu.org; Mon, 18 Mar 2013 19:11:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHjDI-0004fl-DN for bug-guile@gnu.org; Mon, 18 Mar 2013 19:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHjDH-0008B4-9p for bug-guile@gnu.org; Mon, 18 Mar 2013 19:11:32 -0400 Received: from world.peace.net ([96.39.62.75]:39332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHjDH-0008Aq-5O for bug-guile@gnu.org; Mon, 18 Mar 2013 19:11:31 -0400 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UHjDA-0001n6-Hl; Mon, 18 Mar 2013 19:11:24 -0400 From: Mark H Weaver To: bug-guile@gnu.org Subject: Problem with macros whose expansions define and use auxiliary macros Date: Mon, 18 Mar 2013 19:11:17 -0400 Message-ID: <87mwu0fgmi.fsf@tines.lan> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Consider the following module: --8<---------------cut here---------------start------------->8--- (define-module (foo) #:export (foo)) (define-syntax-rule (foo bar) (begin (define-syntax-rule (blah x) x) (define (bar val) (blah val)))) --8<---------------cut here---------------end--------------->8--- and the following session with v2.0.7-204-g1ea3762: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use (foo) scheme@(guile-user)> (foo bar) scheme@(guile-user)> (bar 5) ERROR: In procedure #: ERROR: Wrong type to apply: # Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> --8<---------------cut here---------------end--------------->8--- Note that it works when the same 'foo' macro is entered directly at a fresh REPL: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (define-syntax-rule (foo bar) (begin (define-syntax-rule (blah x) x) (define (bar val) (blah val)))) scheme@(guile-user)> (foo bar) scheme@(guile-user)> (bar 5) $1 = 5 scheme@(guile-user)> --8<---------------cut here---------------end--------------->8--- Mark From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 08:35:24 2013 Received: (at 13995) by debbugs.gnu.org; 20 Mar 2013 12:35:25 +0000 Received: from localhost ([127.0.0.1]:36910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIIEm-0008IS-0D for submit@debbugs.gnu.org; Wed, 20 Mar 2013 08:35:24 -0400 Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:53399 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIIEi-0008IK-M7 for 13995@debbugs.gnu.org; Wed, 20 Mar 2013 08:35:22 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id EA329B391; Wed, 20 Mar 2013 08:33:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=qXdncQeE4dYJ5h0M1gSwOdzpp3A=; b=jVtALL thgSkRLhNnX0/7az2BF3HqQTFWLPY7UK8k4uOsDxU4uUYtYdYI2MM8rdPPrak5s1 AAsDdQTMKNqsolLyvuoEvWq6gLJLmyKtP0dHHFifF4emH6wsFaPWXOHIN6p4VfWl LsLVbG9m5myAq/s//enjJpbr+lGBsL2R6IW3E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=Fkxhwc1MeQlHeDfYkpfp07KEgAAW7+jM h0GO3lLZmc6NOtTxMCS5voF8pgXW+1N3/fs4pq/97+rUfTIXaZMl9bp8XqCzY3xt Olnow88KTKRJL0kpw0mYPfGvQWnJS76RoNyRBo9XNkGNv+a0/y7a8UegHwiMhkCz nvAsKPqHR4E= Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id E2F56B38F; Wed, 20 Mar 2013 08:33:34 -0400 (EDT) Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 4B48DB38D; Wed, 20 Mar 2013 08:33:34 -0400 (EDT) From: Andy Wingo To: Mark H Weaver Subject: Re: bug#13995: Problem with macros whose expansions define and use auxiliary macros References: <87mwu0fgmi.fsf@tines.lan> Date: Wed, 20 Mar 2013 13:33:31 +0100 In-Reply-To: <87mwu0fgmi.fsf@tines.lan> (Mark H. Weaver's message of "Mon, 18 Mar 2013 19:11:17 -0400") Message-ID: <87boae1c9w.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 618EB45E-915A-11E2-A8F6-0B750E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 13995 Cc: 13995@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) Have you tried master? -- http://wingolog.org/ From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 13:32:17 2013 Received: (at 13995) by debbugs.gnu.org; 20 Mar 2013 17:32:17 +0000 Received: from localhost ([127.0.0.1]:37910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIMs4-0007NK-Uk for submit@debbugs.gnu.org; Wed, 20 Mar 2013 13:32:17 -0400 Received: from world.peace.net ([96.39.62.75]:40705) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIMs2-0007NB-EY for 13995@debbugs.gnu.org; Wed, 20 Mar 2013 13:32:15 -0400 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UIMqC-0000BE-Db; Wed, 20 Mar 2013 13:30:20 -0400 From: Mark H Weaver To: Andy Wingo Subject: Re: bug#13995: Problem with macros whose expansions define and use auxiliary macros References: <87mwu0fgmi.fsf@tines.lan> <87boae1c9w.fsf@pobox.com> Date: Wed, 20 Mar 2013 13:30:05 -0400 In-Reply-To: <87boae1c9w.fsf@pobox.com> (Andy Wingo's message of "Wed, 20 Mar 2013 13:33:31 +0100") Message-ID: <87d2uuc736.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13995 Cc: 13995@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Andy Wingo writes: > Have you tried master? I just did, and my toy example works there. Do you think that commit de41e56492666801078e73860a358e1c63cbc8c2 is the reason? It would be nice to get this working in stable-2.0 as well, but I guess that would require working through our disagreement over the handling of macro-introduced top-level identifiers. http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00016.html I still strongly believe that we should follow the standard behavior, namely that each invocation of a macro must introduce fresh identifiers (even if the macro operands are identical) just as every invocation of a procedure must introduce fresh lexical variables (even if the procedure arguments are identical). Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 20 16:22:12 2016 Received: (at 13995-done) by debbugs.gnu.org; 20 Jun 2016 20:22:12 +0000 Received: from localhost ([127.0.0.1]:48073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF5hz-0002L9-Tp for submit@debbugs.gnu.org; Mon, 20 Jun 2016 16:22:12 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:63809 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF5hy-0002L0-B1 for 13995-done@debbugs.gnu.org; Mon, 20 Jun 2016 16:22:10 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 08ABD24FC9; Mon, 20 Jun 2016 16:22:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=LJ0eKC8b4qDlMBu+NtwySpvak2s=; b=bLd+AA sDemBFgwPOiuDAnkNgIFrQHsi3R2wC3//wCfMmU0Ul2wSbxTuNPk5PCE9RG7HdUl HtzCIm/USh3+UVqZXQhi7XoXNu2/qaUaeBpbYqi/NyeS63Dc+tpz5rlTezGjsKeD X29cVfoRPS1lGRIhZwkQAyGNjnJxnTFrWPkc8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=GKIU031Vtl9LdV3vUMhOsMKujyVlB7sd FJKXzQSebyBF0LNDQIt5KBP8ms5/39FYAcRRj9/rbLivz3NQTn553OX962fvYN/E cWwDBY/FTnOB+xFB//vgFJGGfssbZx81WkVcMlp1A3yPkSqIMGj4Tev+4LUV++rm 1+QT8VbUx+0= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 0112624FC8; Mon, 20 Jun 2016 16:22:09 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 1D1EE24FC7; Mon, 20 Jun 2016 16:22:07 -0400 (EDT) From: Andy Wingo To: Mark H Weaver Subject: Re: bug#13995: Problem with macros whose expansions define and use auxiliary macros References: <87mwu0fgmi.fsf@tines.lan> Date: Mon, 20 Jun 2016 22:22:00 +0200 In-Reply-To: <87mwu0fgmi.fsf@tines.lan> (Mark H. Weaver's message of "Mon, 18 Mar 2013 19:11:17 -0400") Message-ID: <87vb137grb.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: A98AB104-3724-11E6-97B7-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 13995-done Cc: 13995-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) So, this example works on master, but for reasons you don't like. We can't fix it on 2.0. If you feel that the solution for macro-introduced identifiers in 2.2 is a release blocker, let's open a thread on -devel again and talk about it, see if we can find some solutions :) In the meantime, closing this one, as there's no 2.0 task and the code "works" in 2.2. Andy On Tue 19 Mar 2013 00:11, Mark H Weaver writes: > Consider the following module: > > (define-module (foo) > #:export (foo)) > > (define-syntax-rule (foo bar) > (begin > (define-syntax-rule (blah x) x) > (define (bar val) (blah val)))) > > and the following session with v2.0.7-204-g1ea3762: > > scheme@(guile-user)> ,use (foo) > scheme@(guile-user)> (foo bar) > scheme@(guile-user)> (bar 5) > ERROR: In procedure #: > ERROR: Wrong type to apply: # > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > scheme@(guile-user) [1]> > > Note that it works when the same 'foo' macro is entered directly > at a fresh REPL: > > scheme@(guile-user)> > (define-syntax-rule (foo bar) > (begin > (define-syntax-rule (blah x) x) > (define (bar val) (blah val)))) > scheme@(guile-user)> (foo bar) > scheme@(guile-user)> (bar 5) > $1 = 5 > scheme@(guile-user)> > > Mark From unknown Mon Jun 23 23:52:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Jul 2016 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator