Extending IAssociative/Associative in clj and cljs

61 views
Skip to first unread message

JvJ

unread,
Apr 16, 2016, 10:19:46 PM4/16/16
to Clojure

I was attempting to create a cross-platform (clojure and clojurescript) datatype that would act as an associative collection.  I can see that cljs has a number of protocols for this under cljs.core.  However, those protocols are not present in clojure.  There is the java interface Associative, but that's not really a clojure protocol.

Is there an easy way to write cross-platform code that can extend associative collections?

Thanks

Timothy Baldridge

unread,
Apr 16, 2016, 10:52:30 PM4/16/16
to clo...@googlegroups.com
You have to do it with CLJC. Not optimal, but that's the way it goes right now. And yeah Associative.java is broken up into multiple smaller protocols in CLJS. 

Timothy

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
(Robert Firth)

JvJ

unread,
Apr 16, 2016, 10:55:43 PM4/16/16
to Clojure
I know I have to do it with CLJC.  I just didn't want to mess around with too many reader conditionals.
Reply all
Reply to author
Forward
0 new messages