On Monday, March 6, 2017 at 1:16:38 AM UTC-6, Mars0i wrote: > > > On Sunday, March 5, 2017 at 6:51:57 PM UTC-6, Alex Miller wrote: >> >> I would really appreciate seeing the ns declaration that caused the >> original error. I have not been able to exactly reproduce what you are >> describing. If you can't share it publicly, you can send it to me at >> alex....@cognitect.com. >> >> Thanks, >> Alex >> > > Thanks--sure, I am willing to make public the ... bad things I am doing in > my code. I have to explain that the ns declaration is very large; it's > generated by a macro that creates a lot of code. I wrote it to ease > interop with a useful but not entirely Clojure-friendly Java library I'm > using. This required violating some standard, useful coding guidelines. > > This file > <https://github.com/mars0i/pasta/blob/master/doc/notes/defsimconfigOutputMarch2017.clj> > > contains pretty-printed output from macroexpand-1 (made with Clojure > 1.8.0--the offending macro call is in an aot-compiled file, so it would > have been harder to start the repl with 1.9.0). There are actually two ns > declarations (a trick to avoid some cyclic references). The code that > caused the errors begins at line 66 in the second ns. > > The macro call in my source is here > <https://github.com/mars0i/pasta/blob/7eaa6835f22f8eecb604e7aa47bfde9d96eac13e/src/clj/free_agent/SimConfig.clj>on > > line 29, and the macro definition is at the bottom of this file > <https://github.com/mars0i/pasta/blob/7eaa6835f22f8eecb604e7aa47bfde9d96eac13e/src/clj/utils/defsimconfig.clj>. > > Both of those links are to the code just before the commit in which I added > apostrophes to the instances of java.lang.Object (at line 210 of the macro > definition file). This got rid of the errors, and the application seems to > run correctly. > > (If you look at the current version of the code, you'll see that I > recently changed the project name from free-agent to pasta; 'lein uberjar' > didn't like the hyphen.) > > If you need me to make a minimal example, I can probably do that. >
I meant to mention, in case it turns out to be relevant, that the other odd thing about this code is that the second ns declaration generated by the macro is a second instance of the ns declaration at the top of the source file. i.e. at the top of SimConfig.clj there's a hardcoded ns declaration (ns free-agent.SimConfig ...), and then the macro inserts a different ns declaration (ns free-agent.config-data), followed a few lines later by a different instance of (ns free-agent.SimConfig ...). It's in the latter that the :gen-class clause which causes the error occurs. The reason for the (ns X), (ns Y), (ns X) strategy is to avoid the potential cyclic dependency problem (forced on me by the MASON library I'm using). -- 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 first post. To unsubscribe from this group, send email to clojure+unsubscr...@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.