[Top][All Lists]

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

Re: [Chicken-users] Unmentioned deviation from R5RS?

From: Thomas Bushnell BSG
Subject: Re: [Chicken-users] Unmentioned deviation from R5RS?
Date: Tue, 29 Dec 2009 22:56:48 -0800

Your understanding is correct.  R5RS does not impose a requirement to
catch all errors.  See section 1.3.2 for more details.  The only errors
that must be reported are failures to open files and EOF while reading
an object (missing right paren, for example).  A program which alters
such a string is thus erroneous, and R5RS does not specify the results
of executing such a program.

Similar to the case you notice is the handling of literals.  Chicken
scheme does not report errors upon modifying literals.  This could cause
(define (foo) '(0)) to start returning surprising results if someone
does something like (set-car! (foo) 1).

What R5RS means by calling these things mutable is that it is an error
to modify them; it does not mean that the implementation is required to
signal that error or block the modification somehow. 


On Wed, 2009-12-30 at 14:46 +0800, Yi DAI wrote:
> Hi, All,
> I recently found a deviation from the R5RS in CHICKEN which is not
> mentioned in the user manual. In R5RS section 3.4, it states as
> follows:
>         In such systems literal constants and the strings returned by
>         symbol->string are immutable objects, while all objects
>         created by the other procedures listed in this report are
>         mutable. It is an error to attempt to store a new value into a
>         location that is denoted by an immutable object.
> However, I found that in CHICKEN, the string returned
> by symbol->string is mutable via string-set!. According to the lines
> above, "it is an error", thus CHICKEN simply choose not to report it
> and silently perform the erroneous operation?
> regards,
> -- 
> _______________________________________________
> Chicken-users mailing list
> address@hidden

reply via email to

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