unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vivien Kraus <vivien@planete-kraus.eu>
To: guile-user@gnu.org
Subject: Dynamically add bindings to the module currently being compiled
Date: Sat, 09 Nov 2024 13:27:44 +0100	[thread overview]
Message-ID: <74edf58cb7ea2a86adee326e1083506b0c2dd34c.camel@planete-kraus.eu> (raw)

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’t get it to work, and I have 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



             reply	other threads:[~2024-11-09 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-09 12:27 Vivien Kraus [this message]
2024-11-09 13:06 ` Dynamically add bindings to the module currently being compiled Maxime Devos via General Guile related discussions
2024-11-09 21:57   ` Vivien Kraus
2024-11-09 22:05     ` Vivien Kraus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74edf58cb7ea2a86adee326e1083506b0c2dd34c.camel@planete-kraus.eu \
    --to=vivien@planete-kraus.eu \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).