This is the mail archive of the
mailing list for the Guile project.
Re: Reintroducing old `defined?'
Jost Boekemeier <email@example.com.TU-Berlin.DE> writes:
> But I still think `eval' should evaluate expressions in any environment
> you pass it:
Note that this means that we will have two environment types:
"environments" and *environments*. :)
How about a name change?
Also, I'm actually not so sure it's a good idea to allow eval in
lexical environments. (It's again a question of protecting the
freedom of interpreter and compiler implementors and avoiding strange
code which could have been written in a clearer style.)
> So you could write a scheme macro that tries to find the binding in the
> local environment list and then in the top level environment by calling
> (environment-bound? (car (the-environment) 'c))
It is my strong opinion that we should aim at having a hygienic macro
system and remove the other macros entirely. The best candidate is
Dybvig's syntax-case macros which is a superset of the R5RS macros.
In such a system, it won't be possible to look at the local
environment, which is a good thing, since macro expansion should be
independent from evaluation. (But there are some primitives in that
macro system which provide similar functionality,)
> > easy to think that they are some kind of generic lexical environments.
> Umm sorry, but what is a "lexical environment"?
A perhaps better name for what we have called "local" environment.
It is called lexical environments because it's a way of representing
lexical scopes of bindings.