On Sep 4, 9:46 am, Chouser <[EMAIL PROTECTED]> wrote:
> On Thu, Sep 4, 2008 at 9:28 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > After sleeping on it, I think what we have been calling ns should be
> > called defns instead, and ns should just set *ns*. Thus there should
> > be only one defns for any particular namespace, and (ns foo) can be
> > used to set the namespace for a file and/or change the namespace at
> > the repl.
>
> > Thoughts?
>
> The other def's have no impact on the state except for the name
> they're defining -- will defns also change *ns*?

Yes. But when used declaratively in a file that is loaded, there is no
lingering change of  the state of *ns*, as a new binding for *ns* is
pushed/popped around the load.

> At the very least it
> may cause other namespaces to be created (via :require for example).
> The other def's, if repeated, fully replace the old definition with
> the new one -- will defns do that, or will it just add any new
> namespaces and aliases to any that already exist?

The latter.

>
> Maybe those are comments about the name more than the functionality.
>

Point taken. But there is no way to 'replace' a namespace, given
compiled-in bindings to vars. re-defing is inherently an interactive
development thing. And other re-defs do not completely replace the old
definition - the var object is the same. In that way, defns would be
similar, just applied to a set of vars/mappings.

> Is there really any harm in re-refering 'clojure if ns (or defns) is
> run a second time on the same namespace?
>

Not at all. The example I gave, where one ns call pulled in only some
of clojure and the other defaulted to all of it, is the problem, and
it arises from using ns for two different purposes.

Rich

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to