I'd like to know how to write the accumulator example included in the Revenge of the Nerds essay. It's easy to understand how it works, however I fail to recreate it in Clojure - it doesn't accumulate but just returns the sum of i and the initial given value of n.
The key is in incf (in the Common Lisp version) or += (in JavaScript).
In other words: how to alter the state of a referenced function? I've seen some examples on mutating variables but they don't look precisely pretty do they?