Re: reader conditional not handling defmacro?

2016-05-27 Thread Nathan Davis
Alex, On the Dev list, you mentioned you had discussed this several times with Rich and others, but were unable to reach concensus. May I ask what the hangup is (i.e., what reservations / objections were expressed) and what other options came out of those discussions? Nathan Davis On

Re: reader conditional not handling defmacro?

2016-05-27 Thread Alex Miller
That is one option and is in the ballpark of http://dev.clojure.org/jira/browse/CLJ-1750. On Thursday, May 26, 2016 at 11:47:09 PM UTC-5, Nathan Davis wrote: > > I can't reply to the thread on the Dev list, but here's my take. > > Unless I'm missing something, it seems to me that most these

Re: reader conditional not handling defmacro?

2016-05-26 Thread Nathan Davis
I can't reply to the thread on the Dev list, but here's my take. Unless I'm missing something, it seems to me that most these issues could be resolved by having a dynamic var that gets set during macro expansion according to the target platform. For instance, *compiler-target* is set to :clj

Re: reader conditional not handling defmacro?

2016-05-22 Thread Herwig Hochleitner
This thread just came up, while I was in the process of composing a mail on this topic to clojure-dev: https://groups.google.com/d/msg/clojure-dev/f6ULUVokXrU/3uue5okSAgAJ 2016-05-20 23:22 GMT+02:00 Dan Burton : > What about something like > > (def obj #?(:clj Object

Re: reader conditional not handling defmacro?

2016-05-20 Thread Dan Burton
What about something like ;; obj.cljc (ns obj) (def obj #?(:clj Object :cljs js/Object)) (defmacro get-obj [] `obj) ;; obj-test.cljc (ns obj-test (:require [obj :refer-macros [get-obj]])) (def gotten-obj (obj/get-obj)) Load obj-test in clj, and obj-test/gotten-obj is Object. Load it in

Re: reader conditional not handling defmacro?

2016-05-20 Thread hiskennyness
Thanks, Sean. (My follow-up fix request went out just as your fix came in.) -kt On Friday, May 20, 2016 at 2:16:47 PM UTC-4, hiskennyness wrote: > > > > On Friday, May 20, 2016 at 1:34:43 PM UTC-4, hiskennyness wrote: >> >> My next problem with .cljc (which is going very very well overall!) has

Re: reader conditional not handling defmacro?

2016-05-20 Thread hiskennyness
On Friday, May 20, 2016 at 1:34:43 PM UTC-4, hiskennyness wrote: > > My next problem with .cljc (which is going very very well overall!) has to > do with macros. > snip > > ps. I will try the old trick of having a helper defn with-defobserver and > with-whatever to see if this is purely a

Re: reader conditional not handling defmacro?

2016-05-20 Thread Sean Corfield
This is because the macros are expanded by Clojure so inside a macro, it always looks like :clj. Take a look at how Expectations gets around this: https://github.com/jaycfields/expectations/blob/master/src/cljc/expectations/platform.cljc#L9-L21 I’d love to hear if there’s an “official”

reader conditional not handling defmacro?

2016-05-20 Thread hiskennyness
My next problem with .cljc (which is going very very well overall!) has to do with macros. Should I mention that I am building under Figwheel? This toolchain stuff has this old Lisper's head spinning. Without a conditional, code using this macro compiles fine (the key bit being where I offer