Evaluate expr under the environment env.
In Gauche, env is just a
R5RS and R7RS provide a portable way to obtain environment.
R5RS way is described below. R7RS way is
scheme.eval - R7RS eval.
Returns an environment specifier which can be used as the second
eval. Right now an environment specifier
is just a module.
(null-environment 5) returns
null module, which contains just the syntactic bindings
specified in R5RS,
scheme module, which contains syntactic and procedure
bindings in R5RS, and
user module that contains all the Gauche built-ins plus
whatever the user defined.
It is possible that the Gauche adopts a first-class environment object
in future, so do not rely on the fact that the environment specifier
is just a module.
An error is signaled if a value other than 5 is passed as version argument.
Gosh’s default read-eval-print loop to applications.
Each argument can be
#f, which indicates it to use Gauche’s
default procedure(s), or a procedure that satisfies the
A procedure that takes no arguments. It is supposed to read an expression and returns it.
A procedure that takes two arguments, an expression and an environment specifier. It is supposed to evaluate the expression and returns zero or more value(s).
A procedure that takes zero or more arguments. It is supposed to print out these values. The result of this procedure is discarded.
A procedure that takes no arguments. It is supposed to print out the prompt. The result of this procedure is discarded.
Given those procedures,
read-eval-print-loop runs as follows:
When an error is signaled from one of those procedures, it is captured and reported by the default escape handler, then the loop restarts from 1.
It is OK to capture a continuation within those procedures and re-invoke them afterwards.