While playing with it, I encountered the following bug in scar function:
arc> (= x '(1 2 3))
(1 2 3)
arc> x
(1 2 3)
arc> (scar x 'a)
a
arc> x
(344739504129 . 10059776)
In Anarki, this bug seems to be fixed, but I don't want to use anarki because it boots very slowly. Does anyone know how to fix this bug in the official version?The stable branch has this bug as well.
I'd compare how x-set-car! is implemented in the two versions. Current HEAD: https://github.com/arclanguage/anarki/blob/6f3fecdaa46e25b34...
stable: https://github.com/arclanguage/anarki/blob/stable/ac.scm#L12...
I suspect Racket's changed something in unsafe-set-mcar! during the move to Chez Scheme.
(Sorry I just saw this.)
-----
Just after that, Racket introduced an easier way to fix this, `unsafe-set-immutable-car!`, specifically as a stable way to mutate the so-called immutable cons cells going forward. :) We should probably move to that.
I've opened an issue for it: https://github.com/arclanguage/anarki/issues/218
-----