I seem to be unable to quote a form and then repeatedly pass it inside the extend-protocol macro...something like this:

(def ^:private co-stub
'(run [this ^String text]
   (let [ann (edu.stanford.nlp.pipeline.Annotation. text)]
     (.annotate this ann) ann)))


(extend-protocol IComponent
edu.stanford.nlp.pipeline.POSTaggerAnnotator      co-stub
edu.stanford.nlp.pipeline.PTBTokenizerAnnotator   co-stub
edu.stanford.nlp.pipeline.WordsToSentencesAnnotator co-stub
edu.stanford.nlp.pipeline.CleanXmlAnnotator       co-stub
edu.stanford.nlp.pipeline.MorphaAnnotator         co-stub
edu.stanford.nlp.pipeline.NERCombinerAnnotator    co-stub
edu.stanford.nlp.pipeline.RegexNERAnnotator       co-stub
edu.stanford.nlp.pipeline.TrueCaseAnnotator       co-stub
edu.stanford.nlp.pipeline.ParserAnnotator         co-stub
edu.stanford.nlp.pipeline.DeterministicCorefAnnotator co-stub
)

neither quoted version nor the back-quoted version work...The former throws : ClassCastException clojure.lang.PersistentList cannot be cast to java.lang.Class clojure.core/implements? (core_deftype.clj:512)

and the latter throws:

ClassCastException clojure.lang.Cons cannot be cast to java.lang.Class clojure.core/implements? (core_deftype.clj:512)

any macro-gurus around?

Jim

--
--
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/groups/opt_out.


Reply via email to