Arc Forumnew | comments | leaders | submitlogin
Bug in scar function in official arc 3.2 implementation
4 points by tubsy 609 days ago | 2 comments
I just installed the latest Racket 8.7 and ran the latest official version of arc (

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)
  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?

2 points by akkartik 599 days ago | link

Interesting. I haven't heard this one before.

The stable branch has this bug as well.

I'd compare how x-set-car! is implemented in the two versions. Current HEAD:


I suspect Racket's changed something in unsafe-set-mcar! during the move to Chez Scheme.

(Sorry I just saw this.)


2 points by rocketnia 556 days ago | link

There was a pull request by samth that fixed this on the main branch, though I guess no one's ever ported it to the stable branch:

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: