Dynamically add bindings to the module currently being compiled

Vivien Kraus <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.