| There is a vexing feature in vanilla implementation of Arc, that components of any complex structure become immutable after reading back from file. If that is not what you want, here is a simple fix: (def mutable (x)
(case (type x)
cons (cons (mutable (car x)) (mutable (cdr x)))
table (w/table h (each (k v) x (= (h k) (mutable v))))
string (copy x)
x))
As you can see, my solution is just to copy everything. Exemplary usage: (zap mutable hairy-structure)
|