[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"
- Re: The empty string and other empty strings, (continued)
- Re: The empty string and other empty strings, Andy Wingo, 2012/01/20
- Re: The empty string and other empty strings, David Kastrup, 2012/01/10
- Re: The empty string and other empty strings, Mike Gran, 2012/01/10
- Re: The empty string and other empty strings, Mark H Weaver, 2012/01/10
- Re: The empty string and other empty strings, Ludovic Courtès, 2012/01/10
- Re: The empty string and other empty strings, David Kastrup, 2012/01/10
- Re: Guile BUG: What's wrong with this?, Bruce Korb, 2012/01/06
- Re: Guile: What's wrong with this?,
Ian Price <=
- Re: Guile: What's wrong with this?, Mark H Weaver, 2012/01/08
- Re: Guile: What's wrong with this?, David Kastrup, 2012/01/06
- Re: Guile: What's wrong with this?, David Kastrup, 2012/01/05
- Re: Guile: What's wrong with this?, Ludovic Courtès, 2012/01/04
- Re: Guile: What's wrong with this?, Mike Gran, 2012/01/03
- Re: Guile: What's wrong with this?, nalaginrut, 2012/01/04
- Re: Guile: What's wrong with this?, David Kastrup, 2012/01/04
- Re: Guile: What's wrong with this?, Ludovic Courtès, 2012/01/04
- Re: Guile: What's wrong with this?, Mark H Weaver, 2012/01/04
- Re: Guile: What's wrong with this?, Mike Gran, 2012/01/04