This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

a local eval


I am currently working on a project which lends itself
to having an eval procedure that is aware of local
environments.  Currently the release version of Guile
does not support this.  The eval provided strictly
considers only the top level environment.  I have a few
questions about this.  If I recall, eval is not
discussed in R4RS so I am wondering what the motivation
of making the eval so limited was.  Is the eval not
aware of local environments because it would be a pain
to make it aware of them, or is it not aware because of
more philosophical reasons?  I am also interested in
how future versions of Guile will handle eval.  R5RS
requires that eval looks like:

(eval /expression/ /environment-specifier/)     procedure

The environment-specifier can be the returned by the
optional procedure (interaction-environment).  The
description follows:

This procedure returns a specifier for the environment
that contains implementation-defined bindings,
typically a superset of those listed in the report.
The intent is that this procedure will return the
environment in which _the implementation would evaluate
expressions dynamically typed by the user._ 

[empahsis added]

I am wondering how the Guile implementors interpret
this.  It does not clearly specify that the result be
just the global environment or whether it be all the
environments between the local environment and the
global environment inclusive (the current environment I
guess).  Personally, I think the more liberal of the
two should be implemented (ie: it should be local
environment aware).  Will this be the case?  Would it
be the case if it was easy to implement that way?

BTW, what I really need personally is a way of taking a
sybol and getting the value bound to that symbol in the
current environment.  If there is some clever way of
doing this in Guile, _please_ let me know.  

Thanks for any help/information.

 -Mike

--
"The spirit of Lisp hacking can be expressed in two sentences. 
 Programming should be fun. Programs should be beautiful."
         -Paul Graham

Instant dorm-room messages: http://eurotrache.mit.edu/talk.html