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]

Re: "environment" unsuitable name for top-level environment


Michael Livshin <mike@olan.com> writes:
> and you are right here.  somehow the word "environment" in the context
> of R*RS stuck in my mind as "the parameter to eval".  oh well.

It is, in the context we are using here, of "environments" as
first-class data types:

> Implementations may extend eval to allow non-expression programs
> (definitions) as the first argument and to allow other values as
> environments, with the restriction that eval is not allowed to create
> new bindings in the environments associated with null-environment
> or scheme-report-environment.

They use the term "environment-specifier" to make clear that Scheme
is not required to support first-class environments, but only a
finite set of values that *specify* an environment.  For example, a
valid implementation uses symbols as environment specifiers:

(define (interaction-environment) 'interaction)
(define (scheme-report-environment version)
  (if (= version 5) 'R5RS (error "bad version")))

(define (eval exp env)
  (.... (if (eq env 'interaction) ....) ...))

It seems clear that in implementations that *do* provide "first-class
environments" that the 2nd parameter to eval *is* an environment.
That is the correct terminology if you want to follow R5RS.
-- 
	--Per Bothner
bothner@pacbell.net  per@bothner.com   http://home.pacbell.net/bothner/

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