scsh-users
[Top] [All Lists]

Re: is this a bug?

To: RT Happe <rthappe@web.de>
Subject: Re: is this a bug?
From: Francisco Vides Fernandez <pax@ns3.dedaloingenieros.com>
Date: Tue, 1 Apr 2003 21:06:26 +0200
Cc: <scsh-news@zurich.ai.mit.edu>
Ok, thanks a lot!

>>>>> "RT" == RT Happe <rthappe@web.de> writes:

 RT> On Tue, 1 Apr 2003, Francisco Vides Fernandez wrote:
 >> Error: exception (set-cdr! '("b" . 2) 3)
 >> 
 >> But the following works fine
 RT> [...]
 >> I'm using scsh 0.6.2. I have tested this with other interpreters
 >> and both work fine. Is this a known bug? Am I doing something
 >> wrong?

 RT> In the first case, you are trying to mutate a constant object.
 RT> The Scheme report says
 RT> <http://www.swiss.ai.mit.edu/~jaffer/r5rs_5.html#SEC22>

 RT>   In many systems it is desirable for constants (i.e. the values
 RT> of literal expressions) to reside in read-only-memory. To express
 RT> this, it is convenient to imagine that every object that denotes
 RT> locations is associated with a flag telling whether that object
 RT> is mutable or immutable. In such systems literal constants and
 RT> the strings returned by
 symbol-> string are immutable objects, while all objects created by
 symbol-> the
 RT>   other procedures listed in this report are mutable. It is an
 RT> error to attempt to store a new value into a location that is
 RT> denoted by an immutable object.  (R5RS section 3.4 Storage Model)

 RT> See also the section on literal expressions.

 RT> rthappe


-- 
+-----------------
| Francisco Vides Fernández <pax@dedaloingenieros.com>
| Director técnico.
| Teléfono fijo:   952 60 29 59
| Teléfono móvil:  661 67 32 73
| Fax:             952 60 29 59
| Dédalo Ingenieros http://www.dedaloingenieros.com/
| PGP: http://pgp.rediris.es:11371/pks/lookup?op=index&search=0x605ecbab
+------



<Prev in Thread] Current Thread [Next in Thread>