Fork me on GitHub

@angusiguess: did you post the link to the post? I missed it so would appreciate the link (I asked here a while ago and the only facilities exist in Clojurescript not clojure proper)


Curious if anyone can explain why there is a (constantly (delay x)) in


@royalaid: So alter-var-root doesn’t just take a symbol and a value, it takes a symbol and a function, which when applied to the value, returns the new value.


The constantly wraps the replacement executor with a function that takes any number of arguments and just returns the executor, which is what’s bound to the executor var.


If you don’t use constantly, it tries to apply the delayed function to the existing value, which breaks.