Unlike symbols, keywords just evaluate to themselves. The keyword :foo will not collide with a var foo, likewise keyword :my-ns/foo will not collide with var my-ns/foo. So, if I understand you correctly, :xsl/ value-of would work just fine.
On Sep 19, 11:56 am, Kyle Schaffrick <[email protected]> wrote: > Would it be correct to say that the namespace portions of keywords are > semantically opaque? > > In other words, if I have a keyword :my-ns/foo and a symbol 'my-ns/foo, > obviously the namespace in the symbol has semantic meaning to the > language when it's evaluated (or syntax-quoted), but the namespace of > the keyword does not appear carry that meaning, almost as if they are > in two separate "meta-namespaces". Is that pretty much guaranteed as > far as the language is concerned? > > I'm asking because I've become the latest in the line of Clojurians to > go tilting at the "SXML-in-Clojure" windmill, and if I decide use the > namespace portion of a keyword (for example :xsl/value-of) I want to be > certain it's always distinct in meaning from any Clojure namespaces or > aliases of the same name. > > The code I teased apart into this library currently uses keywords > like :xsl:value-of to distinguish XML namespaces from Clojure > namespaces, just as a matter of "that was the first thing I thought of", > but it would certainly be saner to stop wasting effort splitting them > apart by hand with string munging and simply bestow my own meaning on > the keywords' namespaces if the language itself doesn't give them any > meaning. > > Thanks, > -Kyle -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
