Why use def? You could just place re? after the definition of defn, and write it:
(defn re? "Return true if x is a regular expression" {:added "1.3"} [x] (instance? java.util.regex.Pattern x)) - James On 23 August 2010 16:17, Jeff Rose <ros...@gmail.com> wrote: > It looks like regular expressions are the only type with built-in > syntax that don't have a predicate function. How about: > > (def > ^{:arglists '([x]) > :doc "Return true if x is a regular expression > (java.util.regex.Pattern)" > :added "1.3"} > re? (fn re? [x] (instance? java.util.regex.Pattern x))) > > Or maybe call it "regexp?" if "re?" isn't clear enough... > > -Jeff > > -- > 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 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