unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Lynn Winebarger <owinebar@free-expression.org>
Cc: guile-devel@gnu.org
Subject: Re: comments on new-model.txt
Date: Mon, 9 Sep 2002 19:30:20 -0500	[thread overview]
Message-ID: <0209091930202H.19624@locke.free-expression.org> (raw)
In-Reply-To: <877khuydrn.fsf@zagadka.ping.de>

On Monday 09 September 2002 17:55, Marius Vollmer wrote:
> Lynn Winebarger <owinebar@free-expression.org> writes:
> 
> >       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).
> 
> What use would be an extloc?  Do you want to export lexical variables?
     Yes
> Or would they be useful for hygienic macro expansion? 
      Not exactly, but the process of writing my own version of syntax-case
has made me think of variables in this way.
> Can you give
> example code that illustrates their use?
     Ok, I'll make up some incredibly bad notation
(exporting-lambda () 
   (define-exportable foo  'whatever)
   (define-exportable-syntax (lambda (x) (syntax-case x () ((_ f ...) (syntax 'xyzzy)))))
   ....)
       If we have extlocs, this can be just a plain lambda that happens
to let import take references to some of its variables.  Then we can
use the keyword "module" instead.

> > Likewise an extvarref would contain both the pointer to the binding
> > and some way of identifying what top-level environment it's from.
> 
> If we need to, we could find the originating module for a imported
> variable also from the module that the current code is executed in.
> This would be slower, but we would not need the extra pointer in
> extvarrefs or variables.

     Part of the disagreement is that I don't think we should
"evaluate in" modules. Partly this is a terminology issue:  I think
"module" should be reserved for separately compilable units of
code that won't be invisibly dependent on whatever code happens
to be currently loaded ("invisibly" is because imports are clearly
visible to the module-using programmer, so are not prohibited).
    We should have some other terminology to describe other types
of namespaces.  Being able to import/export variables is just one
knob on a namespace/environment/whatever.
    And then there's Dirk's view of modules as parameterizable to
get a handle on too.

> > 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).
> 
> What would you do with that pointer?

     I'm thinking about it.

Lynn


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


  reply	other threads:[~2002-09-10  0:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-05  1:22 comments on new-model.txt Lynn Winebarger
2002-09-05 19:06 ` Marius Vollmer
2002-09-08 23:47   ` Lynn Winebarger
2002-09-09 22:55     ` Marius Vollmer
2002-09-10  0:30       ` Lynn Winebarger [this message]
2002-09-10  0:32         ` Lynn Winebarger
2002-09-10 19:56         ` Marius Vollmer
2002-09-10 23:15           ` Tom Lord
2002-09-11 17:38             ` Marius Vollmer
2002-09-11  7:28       ` Lynn Winebarger
2002-09-11 18:11         ` Marius Vollmer
2002-09-14  3:18   ` comments on new-model.txt [long] Lynn Winebarger
2002-09-22 22:13     ` Marius Vollmer
2002-09-24 20:03     ` Marius Vollmer
2002-09-28 23:01       ` Lynn Winebarger
2002-10-12 13:35         ` Marius Vollmer

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=0209091930202H.19624@locke.free-expression.org \
    --to=owinebar@free-expression.org \
    --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).