Re: Should intern obey :dynamic?

2011-10-12 Thread Armando Blancas
> Seems to me that if you're going to use metadata to communicate intention > about dynamic binding in *one* way of creating a new var, you should do it > with *all* ways of creating a new var. And you may be right. My point was that a var's dynamic nature is part of its state: it's primarily da

Re: Should intern obey :dynamic?

2011-10-12 Thread Brian Marick
On Oct 12, 2011, at 3:49 PM, Armando Blancas wrote: >> The metadata tells you why: >> >> user=> (meta #'*dynamo*) >> {:ns #, :name *dynamo*, :dynamic true, :line 1, :file >> ...} > > The var tells you why: > user=> (.isDynamic (var *dynamo*)) > true The mere human who has not read Var

Re: Should intern obey :dynamic?

2011-10-12 Thread Armando Blancas
> The metadata tells you why: > >     user=> (meta #'*dynamo*) >     {:ns #, :name *dynamo*, :dynamic true, :line 1, :file ...} The var tells you why: user=> (.isDynamic (var *dynamo*)) true > > Now let's make another variable with `intern`, copying the metadata from > `*dynamo*`: >     user=> (

Should intern obey :dynamic?

2011-10-12 Thread Brian Marick
Consider this ordinary way of defining a dynamic variable: user=> (def ^:dynamic *dynamo* 3) As you'd expect, you can rebind: user=> (binding [*dynamo* "new value"] *dynamo*) "new value" The metadata tells you why: user=> (meta #'*dynamo*) {:ns #, :name *dynamo*, :dynamic t