Re: Dynamically add bindings to the module currently being compiled

2024-11-09 Thread Vivien Kraus
Le samedi 09 novembre 2024 à 22:57 +0100, Vivien Kraus a écrit : > With your precious help and some digging around, I produced the > attached code. Thank you! P.S. I am a bit perplexed by syntax-parameterize introducing (let () …) forms in the expansion but I think I can work around it by doing de

Re: Dynamically add bindings to the module currently being compiled

2024-11-09 Thread Vivien Kraus
Hello! Le samedi 09 novembre 2024 à 14:06 +0100, Maxime Devos a écrit : >  * Define a mapping of module->collected-strings somewhere. >  * Let G_ add things to this mapping, during _expansion_ (syntax-case > instead of syntax-rules will be needed). >  * Define another macro ‘define-marked-strings’

RE: Dynamically add bindings to the module currently being compiled

2024-11-09 Thread Maxime Devos via General Guile related discussions
If you dynamically add bindings during _expansion_ (instead of expanding to code that _defines_ and exports something), then naturally the compiler never sees it, so it doesn’t end up in .go and when the .go is loaded, that binding isn’t there anymore. Proposed alternative: • Define a mapping

Dynamically add bindings to the module currently being compiled

2024-11-09 Thread Vivien Kraus
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 l