From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vivien Kraus Newsgroups: gmane.lisp.guile.user Subject: Dynamically add bindings to the module currently being compiled Date: Sat, 09 Nov 2024 13:27:44 +0100 Message-ID: <74edf58cb7ea2a86adee326e1083506b0c2dd34c.camel@planete-kraus.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Nov 09 13:29:56 2024 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 1t9kbC-0005kk-O5 for guile-user@m.gmane-mx.org; Sat, 09 Nov 2024 13:29:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9kZZ-0002Ez-Hh; Sat, 09 Nov 2024 07:28:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9kZL-0002C8-Vr for guile-user@gnu.org; Sat, 09 Nov 2024 07:28:04 -0500 Original-Received: from planete-kraus.eu ([2a00:5881:4008:2810::309]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1t9kZI-0006g7-Li for guile-user@gnu.org; Sat, 09 Nov 2024 07:27:58 -0500 Original-Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 3e607e6e for ; Sat, 9 Nov 2024 12:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:date:content-type :content-transfer-encoding:mime-version; s=albinoniA; bh=9dSn4JS 1GWDVmpz4KFzal2bQUxY=; b=SHISIVds2dcur/oEUq90Kd413GDlPkp9sFxYMs9 1By/nxi+mNvcpLmQD+0Qm9IBDXDFs99LSfWSlPBjmkWggP4cAq9tzQiTiK42pM2m tQGLYhkG3yyFm3UqozG6wJ1TfkAEhkrK5KMK0KeSlkxzNj8iWnNWXSGCt6nnmsjj kb1terJ5vlciIKRYANshr+PpJmUnvvYVcdNuED8HVxE/AaEhk9B4WMsV2Xag/1vq 7TdjwgnOBM9E8/Jg90x/g1qQZ+ul+B432NXvrs5xtzZmHbVkIwtUf76sHA47KHGx Ko2d/9Q97lB9zAdXXoRcd+hjEq35okPEj1bGtGT9drpPj1g== Original-Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 2eced998 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for ; Sat, 9 Nov 2024 12:27:46 +0000 (UTC) Received-SPF: pass client-ip=2a00:5881:4008:2810::309; envelope-from=vivien@planete-kraus.eu; helo=planete-kraus.eu 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_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19877 Archived-At: Dear guile users, I would like to define a macro G_ which accepts 1 string literal argument. Whenever it is expanded during the compilation of a module, I would like to dynamically add a binding to that module (named 'marked- strings for instance) to be exported. marked-strings would contain the list of string literals that were used as arguments to the G_ macro anywhere in the module. I tried to use the module reflection API in my macro definition to add bindings to (current-module), but I can=E2=80=99t get it to work, and I hav= e a feeling the compiler is not compiling what I dynamically added there. Am I correct that the compiler does not integrate my dynamically added bindings? Can I have hope to achieve something similar to what I want to do? Best regards, Vivien