Re: seeking advice on idiomatic/readable coding style

2009-08-25 Thread Meikel Brandmeyer
Hi, On Aug 25, 3:57 pm, B Smith-Mannschott wrote: > Yes, that's precisely the intent. ("...Consider the prefix to be the > empty string in for attrs declaring a default namespace.") Oops again. Seems I was also sloppy reading docstrings. :) Sincerely Meikel --~--~-~--~~--

Re: seeking advice on idiomatic/readable coding style

2009-08-25 Thread B Smith-Mannschott
On Tue, Aug 25, 2009 at 15:44, Meikel Brandmeyer wrote: > > Hi, > > here's my try using for: > >    (defn xmlns-attr? >      [k] >      (or (= k :xmlns) (.startsWith (name k) "xmlns:"))) > >    (defn ns-assoc-2 >      [attrs xmlns-map] >      (into xmlns-map >            (for [[k v] :when (xmlns-a

Re: seeking advice on idiomatic/readable coding style

2009-08-25 Thread Meikel Brandmeyer
Hi again, On Aug 25, 3:44 pm, Meikel Brandmeyer wrote: >             (for [[k v] :when (xmlns-attr? k)] Oops. Missed the attrs in front of :when. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: seeking advice on idiomatic/readable coding style

2009-08-25 Thread B Smith-Mannschott
On Tue, Aug 25, 2009 at 15:44, Meikel Brandmeyer wrote: > > Hi, > > here's my try using for: > >    (defn xmlns-attr? >      [k] >      (or (= k :xmlns) (.startsWith (name k) "xmlns:"))) > >    (defn ns-assoc-2 >      [attrs xmlns-map] >      (into xmlns-map >            (for [[k v] :when (xmlns-a

Re: seeking advice on idiomatic/readable coding style

2009-08-25 Thread Meikel Brandmeyer
Hi, here's my try using for: (defn xmlns-attr? [k] (or (= k :xmlns) (.startsWith (name k) "xmlns:"))) (defn ns-assoc-2 [attrs xmlns-map] (into xmlns-map (for [[k v] :when (xmlns-attr? k)] [(-> k name (.replaceAll "xmlns:" "") (.replaceAl

seeking advice on idiomatic/readable coding style

2009-08-25 Thread B Smith-Mannschott
Hello! I've been playing around with clojure in my spare time for a while now and am currently experimenting with ideas for querying XML using clojure. It'll be a while yet before I have something usable, but in the meantime I'd like some advice regarding one of the functions I'm writing. Clojure