SRFI-48 incorrect mutation of literal list in example?
Sudarshan S Chawathe 01 Jan 2016 02:32 UTC
[Resending from subscribed email address; sorry if duplicate.]
I believe the following example in SRFI-48 document is incorrect in R5RS
and beyond, as it mutates a literal constant.
(format "~w" (let ( (c '(a b c)) ) (set-cdr! (cddr c) c) c))
; => "#1=(a b c . #1#)"
I realize this SRFI has been finalized for a while (and I am not aware
of any protocol for errata), but at least the mailing list archives may
serve as a record that could help someone down the road (assuming I am
not mistaken about the above).
[I guess this "outs" me as a format string user. I promise to use it
only very sparingly and cautiously, and I will try to kick the habit in
the new year.]
Regards,
-chaw