guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the status of modules and macros?


From: Rob Browning
Subject: Re: What's the status of modules and macros?
Date: 13 May 2001 12:04:16 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Rob Browning <address@hidden> writes:

> Hmm.  It would be nice if we could figure out a strategy that works
> for macros transparently (without having to re-write any that refer to
> module local bits), but I don't have any suggestions right now :>

Thinking about it a bit more, I tend to think your original solution
makes sense -- if you're defining a macro in a module whose expansion
you want to refer to module internal bits, you *should* have to make
that clear. i.e.

  (define-module (my module))

  (define private-bit ...)

  (define-macro (foo bar)
    `(do-something ,bar
                   (module-ref (my module) private-bit)))

So in the original "compilation" diagram, maybe this suggests that an
intial spec for the output of the front-end compiler could include
statements like:

  - the output will contain no macro references.  All macros will have
    been expanded.

  - the output will contain no implicit references to module bindings.
    These will all have been expanded to (module-ref module-name
    binding).

etc.

(BTW when I say front-end compiler, I mean it in this context:

  sexp -> front-end-compiler -> simplified-scheme -> backend-codegen

 where the backend-codegen is what converts to byte-codes, assembly,
 libX.so, etc.)

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

[Prev in Thread] Current Thread [Next in Thread]