[Top][All Lists]

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

Re: modules, 2nd try.

From: Neil Jerram
Subject: Re: modules, 2nd try.
Date: 20 Sep 2002 19:42:42 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Han-Wen" == Han-Wen Nienhuys <address@hidden> writes:

    Han-Wen> address@hidden writes:
    >> ;; At this point you want to mark all the variables imported from
    >> ;; lily-current-module for re-export.  I'm not sure how you could do
    >> ;; this.  Perhaps something involving module-map or module-for-each.

    Han-Wen> Ah, of course, I could batch these exports. 


    Han-Wen> I think you left out the part where the new scope imports the old
    Han-Wen> (nested) scopes, i.e. [...]

Well, if you do the re-exporting step described in the ;; section just
above, you should only need to import the immediate parent module.
But importing all the ancestor modules is a good alternative to the
re-exporting step, in fact probably nicer.

    Han-Wen> Does your suggestion to use modules mean that there is no other
    Han-Wen> natural way to implement these nested scopes?

Hmm... one to think about.  How would you change the module system
such that there was an easier way to get this behaviour?  Perhaps
there should be something like module-all-interface, like
module-public-interface but giving you all variables; we could then
dispense with all the exporting and re-exporting, and the resulting
system would be quite natural.

One caveat that just occurred to me: with either variant (yours or
mine) of this design, I'm not sure that a variable in an inner scope
will correctly shadow a variable with the same name in an outer
scope.  In your design, it depends on how the module system resolves
conflicts between multiple imports.


reply via email to

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