Using Records+Protocols isn't all that different from using Map+Multimethods,
in theory.
(defrecord Person [name age])
(extend-protocoll Greeter
Person
(greet [person] (println "Hello" (:name person)))
Isn't all that different from
(defn Person [name age] {:name name, :age age, :type :person})
(defmulti Greeter [p] :type)
(defmethod Greeter :person [p]
(println "Hello" (:name person)))
The first version is just a lot faster (up to 5x faster), and easier to type.
Conceptually however, they are the same.
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.