I'm struggling to understand the problem that you're actually trying to
solve. The solution that you are proposing doesn't seem like an elegant
solution to any problem, so could you elaborate on what you're trying to
do?

On Fri, Apr 25, 2014 at 08:58:42AM -0700, Peter West wrote:
> One interesting thing about intern is that it will create *or find* a var, 
> setting its root binding.  That means that var circumvents the immutability 
> of a var, doesn't it? I thought vars were supposed to be immutable.

Vars are not immutable. Clojure has four datatypes which are used for
mutability: Agents, Atoms, Refs and Vars. As I said originally, your
function is mutating the global scope, whether by using `intern` or by
using `def`, and this is generally not a good idea. There is (almost), a
better solution than mutating the global state.

Attachment: signature.asc
Description: Digital signature

Reply via email to