Mark H Weaver <m...@netris.org> writes: > As I understand it, in the Scheme standards (at least before R6RS's > immutable pairs) the rationale behind marking literal constants as > immutable is solely to avoid needlessly making copies of those literals, > while flagging accidental attempts to modify them, since that is almost > certainly a mistake. Erm, if you don't count literals, which were already immutable, then R6RS doesn't have immutable pairs. It does move the mutators to a separate module, but that is a not really equivalent, because even if you don't import (rnrs mutable-pairs), another module may mutate pairs returned by your library. Ditto for strings,etc.
To quote section 5.10 "Literal constants, the strings returned by symbol->string, records with no mutable fields, and other values explicitly designated as immutable are immutable objects, while all objects created by the other procedures listed in this report are mutable." -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"