SRFI 251: Mixing groups of definitions with expressions within bodies

by Sergei Egorov

status: final (2024-05-06)

keywords: Binding

See also SRFI 245: Mixing definitions and expressions within bodies.

Abstract

Scheme has traditionally required procedure bodies and the bodies of derived constructs such as let to contain definitions followed by commands/expressions. This SRFI proposes to allow mixing commands and groups of definitions in such bodies, so that each command/expression is in the scope of all local definition groups preceding it, but not in scope of the local definition groups following it. This approach is backwards compatible with R7RS and upholds the intuitive rule that to find the definition of a lexical variable, one has to look up the source code tree.