Node:Strange Eval, Next:, Previous:Sloppy Membership, Up:Deprecated

36.3 Strange Variations on eval

eval2 was useful in previous Guile releases because the eval in those releases was a single argument eval that did not conform to R5RS. Guile's standard eval now requires a second environment-specifier argument (which Guile interprets as the module in which to evaluate the specified code expression). Hence eval is now R5RS-compliant, and eval2 is obsolete and therefore deprecated.

eval2 obj env_thunk Deprecated Scheme Procedure
scm_eval2 (obj, env_thunk) Deprecated C Function
Evaluate exp, a Scheme expression, in the environment designated by lookup, a symbol-lookup function. Do not use this version of eval, it does not play well with the module system. Use eval or primitive-eval instead.

In previous Guile releases, the implementation of expressions like (eval (read port)) was deficient in that source properties associated with the expression returned by the read would be lost during the eval. To provide a way of performing a read and evaluation without losing source properties, read-and-eval! was invented.

In this Guile release, evaluation always preserves source property information. So read-and-eval! is now unnecessary.

read-and-eval! [port] Deprecated Scheme Procedure
scm_read_and_eval_x (port) Deprecated C Function
Read a form from port (standard input by default), and evaluate it (memoizing it in the process) in the top-level environment. If no data is left to be read from port, an end-of-file error is signalled.