(r5rs.info.gz) Eval
Info Catalog
(r5rs.info.gz) Control features
(r5rs.info.gz) Standard procedures
(r5rs.info.gz) Input and output
6.5 Eval
========
-- procedure: eval expression environment-specifier
Evaluates EXPRESSION in the specified environment and returns its
value. EXPRESSION must be a valid Scheme expression represented
as data, and ENVIRONMENT-SPECIFIER must be a value returned by one
of the three procedures described below. 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'.
(eval '(* 7 3) (scheme-report-environment 5))
==> 21
(let ((f (eval '(lambda (f x) (f x x))
(null-environment 5))))
(f + 10))
==> 20
-- procedure: scheme-report-environment version
-- procedure: null-environment version
VERSION must be the exact integer `5', corresponding to this
revision of the Scheme report (the Revised^5 Report on Scheme).
`Scheme-report-environment' returns a specifier for an environment
that is empty except for all bindings defined in this report that
are either required or both optional and supported by the
implementation. `Null-environment' returns a specifier for an
environment that is empty except for the (syntactic) bindings for
all syntactic keywords defined in this report that are either
required or both optional and supported by the implementation.
Other values of VERSION can be used to specify environments
matching past revisions of this report, but their support is not
required. An implementation will signal an error if VERSION is
neither `5' nor another value supported by the implementation.
The effect of assigning (through the use of `eval') a variable
bound in a `scheme-report-environment' (for example `car') is
unspecified. Thus the environments specified by
`scheme-report-environment' may be immutable.
-- optional procedure: interaction-environment
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.
Info Catalog
(r5rs.info.gz) Control features
(r5rs.info.gz) Standard procedures
(r5rs.info.gz) Input and output
automatically generated byinfo2html