Re: set-car! bug? (or feature)
> R4 says the following should produce an "error" (pg 16). Looks like
> STk allows the function to be directly modified with set-car!
>
> STk> (define (foo) '(a b c))
> #[undefined]
> STk> (foo)
> (a b c)
> STk> (set-car! (foo) 'q)
> #[undefined]
> STk> (foo)
> (q b c)
>
> On the other hand ...
>
> STk> (define (bar) (list 'a 'b 'c))
> #[undefined]
> STk> (bar)
> (a b c)
> STk> (set-car! (bar) 'q)
> #[undefined]
> STk> (bar)
> (a b c)
Yes this is not conform to R4RS and I haven't seen this "detail" before.
I have also tested this case on mit-scheme, elk, scm and scheme48. Only the
latter implement this case well. Handling it correctly implies to be able to
recognize constant and non-constant list. I will try to find a bit in cells to
implement this behaviour (but probaly not for the 2.2).
-- Erick
Received on Wed Jan 11 1995 - 11:05:53 CET
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST