From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: prj@case.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.user Subject: defining macros within eval Date: Sun, 16 Oct 2022 05:39:07 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12140"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Oct 16 15:38:09 2022 Return-path: Envelope-to: guile-user@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 1ok3qC-0002wN-2b for guile-user@m.gmane-mx.org; Sun, 16 Oct 2022 15:38:08 +0200 Original-Received: from localhost ([::1]:51760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok3qA-0003cg-M7 for guile-user@m.gmane-mx.org; Sun, 16 Oct 2022 09:38:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok06z-0006F1-VH for guile-user@gnu.org; Sun, 16 Oct 2022 05:39:14 -0400 Original-Received: from mpv-out-ksl-1.cwru.edu ([129.22.103.228]:26673 helo=mpv-out-ksl-1.case.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok06y-00082S-0Y for guile-user@gnu.org; Sun, 16 Oct 2022 05:39:13 -0400 Original-Received: from mpv-local-cfd-1.CWRU.Edu (EHLO mpv-local-cfd-1.case.edu) ([129.22.103.203]) by mpv-out-ksl-1.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id ABN98010; Sun, 16 Oct 2022 05:39:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1665913148; bh=iLoGnDg1hV8Sjf4se/KPoF5x2di6NvNptTuVFnkcBfM=; l=669; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TT7PkQ0qNZ37BAHcsHRP7dPR1z+bCQOIZ4xSTv//LJ6ZyQCK34Z4Y6mdPmzXMVgXY2 htjlL/V3n2VX16SUoO/iSf1PyoJoV515TY7DYD8FZJK0t8CgkSRIvfMuIVmOfApTGfJ AXWUNRkiUQhBakUIVT44BQpH5CyFEvflkSKYAfwx6va4z/vEQOuUnSRAcwjneFvvol7 GRo/qD7muuLNqQ3bfreJFlFAn38KDwJyiRNlfDEHOl9QLWLwxFKEF/XYGUcEwQ95BgO 2HUvzjK6xxB8+CzBvjGO6BcE4kKuTBWvWLq+u9qwaceGptorLbZpd5ox/St1mBy0Vlr EPXF1xQw== Original-Received: from webapps-d-2.tis.CWRU.Edu (EHLO webapps-d-2.tis.cwru.edu) ([129.22.105.200]) by mpv-local-cfd-1.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id ABG05832; Sun, 16 Oct 2022 05:39:07 -0400 (EDT) Original-Received: by webapps-d-2.tis.cwru.edu (Postfix, from userid 513778) id A2005408BB2; Sun, 16 Oct 2022 05:39:07 -0400 (EDT) Mail-Copies-To: nobody Original-Lines: 16 X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A742F8E.634BD13B.0060, actions=tag X-Mirapoint-IP-Reputation: reputation=good-1, source=Fixed, refid=n/a, actions=tag X-Junkmail-Premium-Raw: score=7/90, refid=2.7.2:2022.10.16.83025:17:7.944, ip=, rules=__RCVD_POSTFIX_UID, DKIM_SIGNATURE, __HAS_FROM, __FROM_NAME_NOT_IN_ADDR, __TO_MALFORMED_2, __TO_NO_NAME, __SUBJ_ALPHA_START, __SUBJ_ALPHA_END, __USER_AGENT, DATE_TZ_NA, __HAS_MSGID, __SANE_MSGID, __MIME_VERSION, __CT, __CT_TEXT_PLAIN, __DKIM_ALIGNS_2, __FUR_HEADER, __BODY_NO_MAILTO, __NO_HTML_TAG_RAW, BODY_SIZE_600_699, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __FROM_NAME_NOT_IN_BODY, __FROM_DOMAIN_NOT_IN_BODY, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, BODY_SIZE_1000_LESS, BODY_SIZE_2000_LESS, __MIME_TEXT_P, NO_URI_FOUND, NO_CTA_URI_FOUND, __URI_NO_MAILTO, NO_URI_HTTPS, BODY_SIZE_7000_LESS, SENDER_NO_AUTH, NO_CTA_FOUND X-Junkmail-Status: score=10/90, host=mpv-out-ksl-1.case.edu X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A742F18.634BD13C.0003, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2016-11-06 16:00:04, dmn=2013-03-21 17:37:32, mode=multiengine X-Junkmail-IWF: false Received-SPF: pass client-ip=129.22.103.228; envelope-from=prj@case.edu; helo=mpv-out-ksl-1.case.edu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 16 Oct 2022 09:37:19 -0400 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18656 Archived-At: Hi. I'm updating some old code to work with newer versions of Guile. This example used to work with 1.8, but gives an error with 2.2 and later: (begin (eval '(define-syntax-rule (rule x) x) (current-module)) (display (rule "ok\n"))) ERROR: Wrong type to apply: # The error happens for define-syntax-rule and define-macro, but not plain define. It happens when eval is within begin or let, but not at the top level. Is there some way to make this work? In my real code, the expression is read from a file, where it might be a macro definition or anything else, and it's evaluated in a different module from the current one.