>> Define some implementations for specific types.
>>
>>  (require '[name.stadig.polyfn :refer [defpolyfn]])
>>  (defpolyfn foo Long [exp] (inc exp))
>>  (defpolyfn foo String [exp] "Hello, World!")

I like the idea, but it seems to go against the pattern set by multi-fns:

(defmulti foo...)
(defmethod foo ...)

Could we do some pattern like that?

(defpolyfn foo...)
(extendpolyfn foo ...)

I'm thinking about situations like testing, repls, etc. When sometimes I
actually do want to completely redefine the function. I'd like a way to
re-create the polyfn.  From what I see above it looks like the creation of
the polyfn is implicit rather than explicit.

Timothy

-- 
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

Reply via email to