Re: XML parsing with namespace prefixes

2012-10-18 Thread Maurits
Bit of a late reaction, but there is nothing special about a tag with a namespace prefixed. For example I have been using: (zf/xml-> zipper :ListRecords :record :metadata :oai_dc:dc :dc:language zf/text) which works perfectly well. Maurits Op zondag 22 juli 2012 22:02:59 UTC+2 schreef Mar

How do I find implemented protocols in Clojure object?

2011-01-11 Thread Maurits
Is there a documented way to find which protocols are implemented by a Clojure object? The other way around (show for which classes a given protocol is extended) is easy: (extenders protocol). Maurits -- You received this message because you are subscribed to the Google Groups "Clojure&q

Re: How do I find implemented protocols in Clojure object?

2011-01-13 Thread Maurits
(map #(isprotocol? (% 0)) (ns-publics *ns*))) just returns sequence which only contains false values. Maurits On Jan 12, 10:48 pm, Bob Hutchison wrote: > On 2011-01-12, at 8:38 AM, Stuart Sierra wrote: > > > One way: > > >     (ancestors (type the-object)) > > > This will inc

Re: How do I find implemented protocols in Clojure object?

2011-01-13 Thread Maurits
Thanks for your answer. I guess the right approach is to check with extends? against the list of protocols that I found in the namespace. Maurits On Jan 13, 2:00 pm, Meikel Brandmeyer wrote: > Hi, > > Try this: > (map #(isprotocol? @(val %)) (ns-publics *ns*))) > > How

Re: How do I find implemented protocols in Clojure object?

2011-01-13 Thread Maurits
Thanks for all the feedback and answers. I have added my implementation below. Maurits - ; test protocol and record (defprotocol Log (log [this] "Method to log")) (defrecord Foo [f1 f2] Log (log [this] (println (:f1 this) (:f2 this (def foo (Foo. 13