From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: Re: definitions in macros? Date: Sun, 22 Mar 2020 12:16:46 -0700 Message-ID: <7b0c63b6-bd75-2f3d-602e-0c8a5a631048@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="52700"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Mar 22 20:17:10 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jG65t-000DZt-E2 for guile-devel@m.gmane-mx.org; Sun, 22 Mar 2020 20:17:09 +0100 Original-Received: from localhost ([::1]:49124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG65s-0004X0-Ff for guile-devel@m.gmane-mx.org; Sun, 22 Mar 2020 15:17:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33294) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG65d-0004Wn-0r for guile-devel@gnu.org; Sun, 22 Mar 2020 15:16:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG65c-00068r-2s for guile-devel@gnu.org; Sun, 22 Mar 2020 15:16:52 -0400 Original-Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:37149) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG65b-00068W-R6 for guile-devel@gnu.org; Sun, 22 Mar 2020 15:16:52 -0400 Original-Received: by mail-pg1-x52a.google.com with SMTP id a32so6010627pga.4 for ; Sun, 22 Mar 2020 12:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=f+sCrx+bpSFG+vrbuO1Fjysww+ZTpVtC3EZ0e0hjmaQ=; b=GZ5oJEw2Q6Eh4gBdvbyTuD0JHXfLL4hc4BFATpO5gIHO3epZDUl0/SBkQBmfZyZhVe ctBGR1GOPM1i2SMGB969aZikpeOAt7v82wFQoUpMeAI2QbGG7fdWLUY2O7xcZUHJ5qvH OaNJMrW/+y+BYl3A452QP1b6i40wsVOTjgtBQIG34dDrd0YUT5zZ5dcmbihitnVT83by TUP6pM8omT8dPJGr5FwZLZA/m1t9m7QYwD8C+bnhFDAgqSOeimdPN9Zhg6INqqrrR0Yg ql4j5tG05DlMsL873jCKnHnmghvHA4v5RSFxxvBIvpRSpR7TiYoYI33FldfKT5lVTkdP JO9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=f+sCrx+bpSFG+vrbuO1Fjysww+ZTpVtC3EZ0e0hjmaQ=; b=fsYA40DCVXhiKt4rT71pBOIgSkfZeEqNEHq/GvUrvCFZ7TG5HayeDRH3J4HfsbysKU JleaHsebsRZNWLtq2CGGlnpwpaq08aTp7ngdBQXWWAscGD518zfssTrv33HBYMCwgo9S iYYAmpHmbOyr+MWT94t0pZTJUHmWaSVHMrmLzYW2tgJ7y+TE9VGW9QRs1lywljkxu9Nz rhDCNetBGJbbMG5ez5lzX2Rmdnd+tg5mt+6lNsTwzL3Uzj3tUhuMPK/XsrVS+eyU2wk1 qIhfXWaoBOyLNNutdKcd9BALBHoCWobZ6SluH5L2P62wlJs2/CB93nsHd1ZSO1nN86Ml rc1Q== X-Gm-Message-State: ANhLgQ0EP2aDRyz8JYlayEl0dfTwLINOFYfUD51S0ztq9ejvN+PhGIrP HdeTQRWXTGqdp13JI+EgrskfVKFQ X-Google-Smtp-Source: ADFU+vshInrgiMHnESJweq3lX/vH3C2/gRIww/Wj0+Q8IVP6y7bdHqZ6WGwr0p30VAigdqJIVemzXA== X-Received: by 2002:aa7:94b5:: with SMTP id a21mr20448612pfl.290.1584904608078; Sun, 22 Mar 2020 12:16:48 -0700 (PDT) Original-Received: from [192.168.2.183] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id a13sm4552272pjh.7.2020.03.22.12.16.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Mar 2020 12:16:47 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52a X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20455 Archived-At: On 3/22/20 12:07 PM, Han-Wen Nienhuys wrote: > Hi there, > > in my quest to get lilypond working with GUILE 2+, I've hit another > stumbling block. > > In order to make compilation with GUILE 2+ working, we have to move > away from runtime symbol definition (ie. module-define! calls). > > In the code below, it looks like only one of the two definitions in > the body of my-macro-new takes effect. Is this expected, and if so, > why? > > (defmacro-public my-macro-old (command-and-args . definition) > (module-define! (current-module) 'x1 "I am X1\n") > (module-define! (current-module) 'x2 "I am X2\n")) > > (defmacro-public my-macro-new (command-and-args . definition) > `(define p "i am P\n") > `(define q "i am Q\n")) > > > (my-macro-old 1 2) > (my-macro-new 1 2) > (display x1) > (display x2) > (display q) > (display p) > > > thanks, > Try the following.  Not sure about defmacro but define-syntax must return a single form. (defmacro-public my-macro-new (command-and-args . definition) `(begin (define p "i am P\n") (define q "i am Q\n")))