[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile: What's wrong with this?

From: Ian Price
Subject: Re: Guile: What's wrong with this?
Date: Sat, 07 Jan 2012 20:57:15 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Mark H Weaver <address@hidden> 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"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]