Thank you for  your response.
The reasons why I didn't use protocols are following.
1.
Currently ClojureScript doesn't have `extend`, which makes inheritance
easy.
http://david-mcneil.com/post/1475458103/implementation-inheritance-in-clojure

2.
I think an entity which is created by deftype or defrecord should
represent a value rather than an identity, after reading this article.
http://clojure.org/state
The methods I implemented need to update an entity value itself.
So in order to follow immutable manner, the methods should return a
return value and an updated entity itself.
This programming style is difficult when a method needs to call
another method or makes callback which need to update an entity
itself.
I suspect that to include atoms as fields of record make the entity an
identity. Is this wrong?

Thanks.

On Jan 19, 8:57 am, Dave Sann <daves...@gmail.com> wrote:
> If you are only dispatching on a single type - I think protocols will
> always be much faster than multimethods.
>
> I think that you only really want to use multimethods if you need to
> dispatch on more than one type or on something that is not a type at all.
>
> D

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