How do I do something like this in Arc? (= defx* "foo")
(def stdx () defx*)
(def w/stdx (s thunk)
(let defx* "bar"
(thunk)))
So that (w/stdx "bar" (fn () (stdx)))
returns "bar" instead of "foo".Here's what I came up with: (def stdx () (atomic defx*))
(def w/stdx (s thunk)
(atomic
(let oldx defx*
(after
(do (= defx* s)
(thunk))
(= defx* oldx)))))
Is there a more elegant way to do this?
Like some way to declare defx* as special
so it doesn't get stored in closures? |