Different macro definitions via reader conditionals?

127 views
Skip to first unread message

Michael Sperber

unread,
Jul 2, 2015, 8:09:55 AM7/2/15
to clo...@googlegroups.com
I'd like to define a macro differently for Clojure and for ClojureScript.

Is there a way to do this via reader conditionals?  (My mind boggles.)

Regards,
Mike

Leon Grapenthin

unread,
Jul 2, 2015, 9:01:24 AM7/2/15
to clo...@googlegroups.com
It seems like the only way is to define two macros and call the desired one using reader conditionals.

Mike Fikes

unread,
Jul 2, 2015, 9:20:17 AM7/2/15
to clo...@googlegroups.com
I’m interested in whether there is a nice answer to this as well. 

FWIW, I was recently pondering a closely related subject—portability that additionally extends to bootstrapped ClojureScript:


(Hoping things don’t become excessively combinatorial.)

- Mike

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

Leon Grapenthin

unread,
Jul 2, 2015, 10:19:12 AM7/2/15
to clo...@googlegroups.com
@Mike: Great post. I think you should make it more explicit that the :cljs branch of the macro is never used on Clojure and CLJS/JVM.

Kind regards, Leon.

Mike Fikes

unread,
Jul 3, 2015, 8:32:27 AM7/3/15
to clo...@googlegroups.com
Great suggestion Leon! I’ve updated the post.
Reply all
Reply to author
Forward
0 new messages