On Fri, Jul 8, 2011 at 12:58 AM, David Nolen <[email protected]> wrote:
> (extend-type Object > ISeqable > (seqable? [x] > (let [c (.getClass x)] > (if (.isArray c) > (do > (extend-type (.getClass x) > ISeqable > (seqable? [x] true)) > true) > (do > (extend-type (.getClass x) > ISeqable > (seqable? [x] false)) > false))))) > On Thu, Jul 7, 2011 at 11:21 PM, Ken Wesson <[email protected]> wrote: >> ... it won't use the protocol to cache the result. Making it do so, however, >> would cause problems if one had (seqable? some-foo) and later attempted >> to extend the protocol to mark Foos as seqable within the same runtime >> session. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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
