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:
> > > 
> > > <enable extra reader syntax> (if applicable)
> > > (let ()
> > >     <magic to make imports work>
> > >     (define ...)
> > >     (define-syntax-rule ...) ...
> > >     ;; use a new macro using syntax-local-binding
> > >     ;; to extract the syntax transformer (*).
> > >     <insert stuff in hash tables>)
> > > 
> > > (*) 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 <insert stuff in hash tables> 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.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to