macroexpand in uberjar

2018-02-15 Thread 'Burt' via Clojure
Here is something strange, and I don't see why! Can anybody help? This is the code in m.clj (ns m (:gen-class)) (defmacro mx [x] (list 'y)) (defn -main [] (println (macroexpand-1 '(mx P))) (println (macroexpand-1 '(and P Q 1 When i load the namespace into a REPL and invoke (-mai

Re: macroexpand in uberjar

2018-02-15 Thread Matching Socks
Does the "uberjar" contain .class files for your "m" namespace? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

Re: macroexpand in uberjar

2018-02-15 Thread Nicola Mometto
Use ` instead of ' > On 15 Feb 2018, at 08:45, 'Burt' via Clojure wrote: > > Here is something strange, and I don't see why! > Can anybody help? > > This is the code in m.clj > > (ns m > (:gen-class)) > > (defmacro mx > [x] > (list 'y)) > > (defn -main [] > (println (macroexpand-1 '(

Re: macroexpand in uberjar

2018-02-15 Thread Justin Smith
To elaborate on Nicola's correct answer, when -main is run from outside its namespace, the binding of mx comes from the current environment (which doesn't see a macro, and likely has no binding for mx). If you use ` in -main, the currently visible binding is properly namespace qualified so that it

Re: macroexpand in uberjar

2018-02-15 Thread 'Burt' via Clojure
Thanks Nicola and Justin, syntax quote works, if the call of the macro is explicitely given in the code. In the real situation, whereI had the problem, the form which contains the macro call is generated on the fly by a function. But your hint helps nethertheless: I bind the namespace to that i

Re: try catch leaking exception

2018-02-15 Thread icamts
Thanks for the advice. I will keep it in mind. Luca Il giorno mercoledì 14 febbraio 2018 20:05:32 UTC+1, Erik Assum ha scritto: > > There is also https://github.com/magnars/realize/blob/master/README.md which > helps with this problem. > > Erik. > -- > i farta > > 14. feb. 2018 kl. 12:20 skr