Le mercredi 09 août 2023 à 11:42 +0200, Maxime Devos a écrit : > > > Op 09-08-2023 om 01:00 schreef Jean Abou Samra: > > Le mardi 08 août 2023 à 21:38 +0200, Maxime Devos a écrit : > > > As such, this not working on the top-level seems a bug to me -- after > > > all, a module definition is conceptually just a big let: > > > > > > (if applicable) > > > (let () > > >     > > >     (define ...) > > >     (define-syntax-rule ...) ... > > >     ;; use a new macro using syntax-local-binding > > >     ;; to extract the syntax transformer (*). > > >     ) > > > > > > (*) not sure if that precise approach actually works in this context > > > > > > > > This is very tempting to believe, and I wish it were true, but it's not > > true. > > > > At least in Guile, the part doesn't happen > > at the end of evaluating the module. Each module variable is created and > > inserted while evaluating the define form. Otherwise this would give > > an error: > > > > (define a 5) > > (define b (module-ref (current-module) 'a)) > > (display b) > > I don't see a problem here, only a little backwards-incompatibility (I > mean, you could just ... not do that, and do (define b a) instead). I didn't say that it couldn't be improved, only that it didn't work like you described in current Guile.