(sort (fn (x y) (< (len x) (len y))) '("orange" "pea" "apricot" "apple"))
Error: "set-car!: expected argument of type <pair>; given: 560365568"
arc> (sort < '("orange" "pea" "apricot" "apple"))
Error: "set-car!: expected argument of type <pair>; given: 577273856"
What version of Racket are you using? I'm running 8.2, and I see some weirdness: arc> (let x '("orange" "pea" "apricot" "apple") (= (car x) 1))
1
arc> (let x '("orange" "pea" "apricot" "apple") (= (car x) 1) x)
Error: "invalid memory reference. Some debugging context lost"
The "bleeding edge" community repo at https://github.com/arclanguage/anarki doesn't seem impacted.Edit 14 minutes later: looks like 7.7 shows identical errors.
Edit 45 minutes later: all this works fine with Racket 6.0. That version was already dealing with immutable lists by default (https://download.racket-lang.org/releases/6.0/doc/compatibil...), so I'm inclined to consider this a regression in Racket.
-----