SRFI 251: Mixing groups of definitions with expressions within bodies

by Sergei Egorov

status: draft (2023-11-30)

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 definitions preceding it, but not in scope of the local definitions 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.