unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: guile-devel@gnu.org
Subject: Re: new-model.text, please comment
Date: 15 Sep 2002 00:05:08 +0200	[thread overview]
Message-ID: <87wupop6qz.fsf@zagadka.ping.de> (raw)
In-Reply-To: <m3admlyb5a.fsf@laruns.ossau.uklinux.net>

Neil Jerram <neil@ossau.uklinux.net> writes:

> Here are my few thoughts.  I don't have much experience or expertise
> in this area, so feel free to explain the obvious to me if that's what
> I've asked for :-)

Heh, I'm totally new to this stuff as well...

>     Marius> The output of the compiler is not specified.  Also,
>     Marius> execution of languages other than Scheme is not
>     Marius> considered.  It is assumed that additional languages are
>     Marius> first translated to Scheme (or whatever variant of Scheme
>     Marius> we offer) and then compiled normally."
> 
> High level thought -- is all of this new thinking necessary?  Are we
> unnecessarily ignoring useful stuff that has already been worked
> through on other projects?

Is there much new stuff in it?  I think what I have written down is
quite minimal, and very Guile specific as well.

>     Marius> When a module is created, the set of bindings is empty.
>     Marius> You can add bindings to the set, but you can not remove
>     Marius> them.  Existing bindings can not be changed.  There can be
>     Marius> at most one binding with a given symbol.
> 
> So it is impossible to change an existing macro definition?

Uhh, ohh.  That's what the rules say, but it's not what I intended.  I
think it is OK to change a macro definition, much as you can change a
function definition.  The text doesn't say what a macro transformer
really is.  We could just say that it is some kind of object that
contains a function.  The text does not allow the object to be
replaced by a different object, but the object can be modified (like
variables can be modified).

The alternative would be to change the rules and say that a macro
transformer can be replaced with a different macro transformer, but
that might not be as clean.

>     Marius> During compilation of a file that defines a module, that
>     Marius> module is partially constructed (via code executed by
>     Marius> eval-case).  The constructed module is made the current
>     Marius> module, but it is not registered in the system.  Requests
>     Marius> for a module with the name of the module-being-compiled
>     Marius> will not find the partially constructed module.  When the
>     Marius> compiler wants to follow a :module-ref statement with an
>     Marius> explicit name, it must check whether that name refers to
>     Marius> the partially constructed current module.
> 
> Don't understand the point here.  What are you trying to say by "will
> not find the partially constructed module"?

There is a global mapping from module names to module objects.  When a
module is created by executing a 'define-module' form, it is
registered in that global mapping so that 'use-modules' etc can find
it.  When a module is compiled, we need a compile-time representation
of the module, however, for keeping track of imports and macro
definitions, etc.  That representation can be a real module object,
but it would be wrong to register its name in the global mapping since
the module will only be partially constructed.

When a 'use-modules' form or equivalent is comiled, the referenced
module is loaded just as it would be loaded when the 'use-modules'
form is executed.  When the referenced module in turn references the
module that is currently being compiled, it can not use the partially
constructed compile-time represenation of the module-being-compiled.
The module is then loaded from source or an old compiled version is
used (if it isn't already present in the system anyway).

However, 'module-ref' forms can also refer to the
module-being-compiled by its real name in addition to the special name
'#t'.  That real name needs to be resolved to the compile-time
representation.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


      parent reply	other threads:[~2002-09-14 22:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11 18:05 new-model.text, please comment Marius Vollmer
2002-09-12 22:48 ` Tom Lord
2002-09-14 22:48   ` Marius Vollmer
2002-09-15  0:50     ` Tom Lord
2002-09-15  0:55     ` Tom Lord
2002-09-21 20:27       ` Marius Vollmer
2002-09-12 23:28 ` Rob Browning
2002-09-13 20:22   ` Marius Vollmer
2002-09-13 20:34     ` Rob Browning
2002-09-13 18:53 ` Neil Jerram
2002-09-13 22:06   ` Rob Browning
2002-09-14  1:15     ` Lynn Winebarger
2002-09-14 22:05   ` Marius Vollmer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wupop6qz.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).