unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ian Zimmerman <itz@buug.org>
Subject: Re: environments
Date: 23 Mar 2004 17:21:50 -0800	[thread overview]
Message-ID: <87y8prvy35.fsf@buug.org> (raw)
In-Reply-To: <87isgvhyyv.fsf@zagadka.ping.de>


I wrote:

Ian> guile> (use-modules (ice-9 r5rs))
Ian> guile> (define e (null-environment 5))
Ian> guile> (environment? e)
Ian> #f
Ian> guile> 
Ian> 
Ian> Comments?

Marius> There are two kinds of environments in Guile.  No no, three,
Marius> there are three types of environment in Guile.  The one that is
Marius> tested for by 'environment?' is not used.  It should probably be
Marius> removed or deactivated.

Marius> (There was a plan to use the unused kind of environments as the
Marius> underlying data type for implementing the module system.  The
Marius> other two kinds of environments are the data structures used to
Marius> implement the 'lexical' environment in the interpreter (very low
Marius> level) and the modules, which might also be called top-level
Marius> environments.)

So, how can I get an object (an environment, module, or whatever) that:

1/ can be used as an argument to @code{eval}

2/ can be enriched with new bindings on the fly

I am looking at mzscheme, it has "namespaces" that seem to fit the bill
exactly.  What I hope to do is something like:

(define foo 1)
; how to implement make-env?  with resolve-module, current-module, ..?
(define e (make-env)) 
(eval '(define foo 2) e)
foo
=> 1
(eval 'foo e)
=> 2

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.


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


  reply	other threads:[~2004-03-24  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 18:55 environments Ian Zimmerman
2004-03-24  0:26 ` environments Marius Vollmer
2004-03-24  1:21   ` Ian Zimmerman [this message]
2004-03-24 15:06     ` environments Paul Jarc
2004-03-24 17:39       ` environments Ian Zimmerman
  -- strict thread matches above, loose matches on Subject: below --
2012-12-03 15:24 Environments Sjoerd van Leent Privé

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=87y8prvy35.fsf@buug.org \
    --to=itz@buug.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).