Summary
[R7RS] Initial environment of a CHICKEN program should be empty
Metadata
- Id: be15e6a2c19b112ab7f2fbcef63179d187a1b363
- Trac id: 1861
- Type: defect
- Reporter: zaifir
- Owner:
- Cc:
- Status: new
- Component: unknown
- Estimated difficulty: easy
- Resolution:
- Priority: major
- Milestone: someday
- Version: 5.4.0
- Changetime: 2025-11-29 00:14:41 UTC
- Created: 2025-11-29 00:14:41 UTC
- Keywords:
Description
R7RS (ยง5.1) requires that no identifiers be bound in the initial environment of a program. Yet there seems to be no way to prevent CHICKEN from importing all of (chicken base) into a CHICKEN program. According to the Report, `print` should be unbound in the following program:
(import (scheme base)) (print "hello, world")
csc 5.4.0 compiles this (and the resulting binary runs) without an error, since `print` is in `(chicken base)`, which is automatically imported.
Another result of this asymmetry is that the import qualifiers `only`, `prefix`, `rename`, etc. are effectively useless for `(chicken base)` and `(scheme)`.
R7RS is right, at least for CHICKEN in r7rs mode: any identifiers used but not defined by a program should be explicitly imported.
Addendum: The wiki.call-cc.org page for `(chicken base)` suggests that the `-explicit-use` compiler option can be used to avoid "using" the module, but Bunny351 says this option is unrelated to this issue.