I am trying to use a multi-method that dispatches base on the result returned
by (type)
(defonce str-type (type "a"))
(defmulti position #(type %))
(defmethod position str-type [element x y z]
z)
(position "abc" 1 2 3)
This works but I'd like to use a literal representation of the type of a
javscript string instead of using (type "a")
(type "a") returns
#object[String "function String() { [native code] }"]
but using that in the dispatch value gives a syntax error
(defmethod position #object[String "function String() { [native code] }"]
[element x y z]
z)
The above does not work
--
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 https://groups.google.com/group/clojurescript.