Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
Please forgive about this defn! macro, it does not seem to play well in practice. I now share Konrad's thoughts : I don't know if what he want is feasible without changes in clojure, or use of clojure non-public APIs. 2009/3/3 Laurent PETIT > Now that I rethink about it, wouldn't this version u

Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
Now that I rethink about it, wouldn't this version using eval be less than ideal as far as AOT compilation is concerned ? 2009/3/3 Laurent PETIT > So there we are with a version of defn, which I called defn! because it is > even more agressive than defn in its side effects, that could solve your

Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
So there we are with a version of defn, which I called defn! because it is even more agressive than defn in its side effects, that could solve your problem : (defmacro defn! "Like defn, but first ensures that if name is bound to something (e.g. the name of a function in a 'used' or 'required'

Re: Namespaces, use, and refer

2009-03-03 Thread Christophe Grand
Konrad Hinsen a écrit : > On 03.03.2009, at 00:53, Laurent PETIT wrote: > > >> I'm able to do that from the REPL when done one by one : >> (clojure.core/ns-unmap *ns* (quote filter)) >> (clojure.core/defn filter [] "oh my!") >> >> thus correctly redefining the binding of filter for the rest of

Re: Namespaces, use, and refer

2009-03-02 Thread Konrad Hinsen
On 03.03.2009, at 00:53, Laurent PETIT wrote: > I'm able to do that from the REPL when done one by one : > (clojure.core/ns-unmap *ns* (quote filter)) > (clojure.core/defn filter [] "oh my!") > > thus correctly redefining the binding of filter for the rest of use > by the ns > > But I can't man

Re: Namespaces, use, and refer

2009-03-02 Thread Laurent PETIT
Konrad, I'm able to do that from the REPL when done one by one : (clojure.core/ns-unmap *ns* (quote filter)) (clojure.core/defn filter [] "oh my!") thus correctly redefining the binding of filter for the rest of use by the ns But I can't manage to get it work from a macro (indeed not even when d

Re: Namespaces, use, and refer

2009-03-02 Thread Antony Blakey
On 02/03/2009, at 7:23 PM, Konrad Hinsen wrote: > For namespaces other than clojure.core, an acceptable solution is to > use the :only keyword in the :use clause of the ns macro. This just > requires a bit more work in typing, but I don't see any other > potential difficulty. I am currently conv

Re: Namespaces, use, and refer

2009-03-02 Thread Konrad Hinsen
On Mar 2, 2009, at 18:35, srolls wrote: > I think :exclude is what you want > > (ns my-ns > (:refer-clojure :exclude [get replace])) Not quite, as exclude requires me to know what I want exclude. What I want is "exclude everything that wasn't there in version X.Y". Konrad. --~--~-~-

Re: Namespaces, use, and refer

2009-03-02 Thread srolls
On Mon, Mar 2, 2009 at 12:53 AM, Konrad Hinsen wrote: > > Over the last weeks, two additions to clojure.core broke several of > my library modules by introducing names into the clojure.core > namespace that I was using in my libraries as well. While this kind > of problem is acceptable in a pre-re

Namespaces, use, and refer

2009-03-02 Thread Konrad Hinsen
Over the last weeks, two additions to clojure.core broke several of my library modules by introducing names into the clojure.core namespace that I was using in my libraries as well. While this kind of problem is acceptable in a pre-release development period, I don't expect it to go away w