You're quite right, but the right fix is to remove define, define-record, and define-values; expressions only.  Done and PRed.

On Mon, Sep 2, 2019 at 3:38 AM Lassi Kortela <> wrote:
It might be worth clarifying what happens with:

(eval '(define foo 1) (environment '(srfi 172)))

The SRFI says that it specifies an "*immutable* global environment
containing only specified libraries" which hints that trying to define
anything in that environment is an error. (From the R7RS definition of
eval: "If <expr-or-def> [...] is a definition, the specified
identifier(s) are defined in the specified environment, provided the
environment is *not immutable*." It'd be good to state this explicitly.