guile-devel
[Top][All Lists]
Advanced

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

Re: comments on new-model.txt


From: Lynn Winebarger
Subject: Re: comments on new-model.txt
Date: Sun, 8 Sep 2002 18:47:34 -0500

On Thursday 05 September 2002 14:06, Marius Vollmer wrote:
> Lynn Winebarger <address@hidden> writes:
> Ick, it's in CVS (workbook/compilation/), but I'm not yet really
> prepared to defend it! ;)
    Well, when I saw it appear on guile-cvs, I had to check it out.
I'm surprised there haven't been other responses, but maybe
the beginning of the academic year affects a lot of people here. 
     I'm not ready to respond completely, but I can clarify something.

> >     Rather than tying imported variables to solely to modules, I
> > believe GUILE should adopt 2 new types of variables, extloc and
> > extvar (or whatever) corresponding to ilocs and variables, but
> > carrying a reference to their environment with them.  Space might be
> > conserved by pointing into a table of environments rather than using
> > a whole pointer.  In this way we can untie option 2 from options 1
> > and 3.
> 
      So, we have two SCM types, ilocs and variables (actually variable 
bindings,
but we can leave that for later).   ilocs always look up their values in the
data environment of their closure, and variables are just pointers to a
storage location.  An extloc would be like an iloc (that is, a frame offset
and distance in a frame), but would be stored in a cell where the second
word pointed to the data environment to look it up in (the first word would
contain the frame offset and distance).  Likewise an extvarref would 
contain both the pointer to the binding and some way of identifying
what top-level environment it's from.
     This would be a convenient way to represent imported variables.
The only concrete reason I can offer for including a pointer (of some 
form) to the top level environment of an external variable (actually
any top-level variable) is for ones that aren't bound at the time
of parsing (recalling that correct macro expansion can't be lazy in
the presence of side-effects, as some of the syntax-case examples
I've been posting should demonstrate).  I have a feeling that the pointer
to the top-level environment might turn out to be useful in some other
way, but I couldn't say what that would be.
     
Lynn




reply via email to

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