Here's the solution I came up with:

(s/defn qualify :- s/Symbol
  "Convert a symbol to a qualified symbol.  If the
symbol does not already refer to an existing var,
default to the current namespace."
  [sym :- s/Symbol]
  (let [res (resolve sym)
        ns (or (and res (-> res (meta) (:ns) (.name) (name)))
               (-> *ns* (.name) (name)))
        nme (name sym)]
    (symbol ns nme)))

On Wednesday, 20 January 2016 08:36:49 UTC-8, kovasb wrote:
>
> Are you looking for https://clojuredocs.org/clojure.core/resolve ?
>
>
> On Wed, Jan 20, 2016 at 3:11 AM, JvJ <kfjwh...@gmail.com <javascript:>> 
> wrote:
>
>> With the syntax quote, all symbols become namespace-qualified.  (I.e `a 
>> => user/a, `def=> clojure.core/def)
>>
>> Is there a way to determine how a given symbol would be qualified in the 
>> current environment, and to find out what it's implicit namespace would be?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to