Re: Syntax-quote only as a reader macro?

2009-02-26 Thread Konrad Hinsen
On 26.02.2009, at 20:25, Chouser wrote: > I've got essentially the same thing for use in error-kit: > > (defn- qualify-sym [sym] > (let [v (resolve sym)] > (assert v) > (apply symbol (map #(str (% ^v)) [:ns :name] Except that you get the information from the metadata. I won

Re: Syntax-quote only as a reader macro?

2009-02-26 Thread Chouser
On Thu, Feb 26, 2009 at 9:36 AM, Konrad Hinsen wrote: > > I figured out one way to do it, but it relies on features that are > perhaps not safe to rely on: I get var first, and then I get the > var's namespace from its public attribute ns: > > (defn qualified-symbol >   [s] >   (if-let [var (reso

Re: Syntax-quote only as a reader macro?

2009-02-26 Thread Konrad Hinsen
On Feb 26, 2009, at 13:04, Konrad Hinsen wrote: > Of course that should better be ... > > so that it doesn't mess up already qualified symbols. And even that is not good enough: it won't handle symbols/vars from other namespaces that are referred to. And that's where I am lost. I can't find

Re: Syntax-quote only as a reader macro?

2009-02-26 Thread Konrad Hinsen
On Feb 26, 2009, at 12:26, Konrad Hinsen wrote: > At the moment I am using the following function, which does a syntax- > quote for a single symbol: > > (defn symbol-in-current-ns >[s] >(symbol (str *ns*) (str s))) Of course that should better be (defn qualified-symbol [s] (let [s

Syntax-quote only as a reader macro?

2009-02-26 Thread Konrad Hinsen
I am trying to do the equivalent of a syntax-quote (converting unqualified symbols to namespace-qualified symbols) inside a macro, but it seems there is no built-in function to do this. Am I overlooking something? At the moment I am using the following function, which does a syntax- quote