guile-devel
[Top][All Lists]
Advanced

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

Re: module naming


From: thi
Subject: Re: module naming
Date: Wed, 25 Apr 2001 12:15:57 -0700

   From: Rob Browning <address@hidden>
   Date: 24 Apr 2001 15:33:08 -0500

   Well, currently, the symbols aren't visible until the relevant .scm
   file is loaded, and that's when the top-level code runs.  If we
   wanted import-from to work even without a "use-modules" statement,
   then we'd still have to have specify when the top-level code
   executes.  My guess is upon reaching the first use-modules *or*
   import-from statement mentioning a given module.

i am confused about which top-level code you refer to: that of the
module-user or of the used module?

here's my understanding: when a module is loaded, all its forms are
evaluated unconditionally.  loading occurs either due to explicit call
to `load' (or variants) or through module system machinations.  the
loaded module can declare bindings to export, if any.  the module system
loads a module only once even in the presence of multiple `use-modules'
forms.  (not directly related, but for completeness...) to follow
protocol, the loaded code must have a `define-module' form initially (or
at least, very early on) that declares a module name that matches what
the module sytem is requesting.

under this scheme, it is not possible for the module-*user* to specify
what forms in the used module are to be evaluated, only what definitions
it (the module-*user*) wishes to see (and in our proposal in progress,
the names for those definitions, aka bindings).

i guess i don't see how an `import-from' would work at all w/o doing an
implicit `use-modules' anyway.  maybe we are saying the same thing. :->

   Seems reasonable, though I think it might be useful to support an
   in-line/programmatic import-from command to parallel our export
   command.  This makes some code easier to write, and is friendlier to
   automatic code generation too.

maybe i'm misunderstanding still ... could you explain what you mean by
"in-line/programmatic"?  it seems to me that what you describe is the
function of `use-modules', which we already have, although w/o selection
or renaming, both of which are separate and completely after loading /
definition.

thi



reply via email to

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