pprint depends on order of compilation
pprint causes problems with the build process:
1. c.c.pprint.ColumnWriter
2. c.c.pprint.PrettyWriter
3. c.c.pprint
The first two are gen-class'd, and PrettyWriter extends the class
generated for ColumnWriter.
Unless they are compiled in exactly the order given above, the build
fails with a ClassNotFoundException.
1. c.c.pprint.ColumnWriter
2. c.c.pprint.PrettyWriter
3. c.c.pprint
The first two are gen-class'd, and PrettyWriter extends the class
generated for ColumnWriter.
Unless they are compiled in exactly the order given above, the build
fails with a ClassNotFoundException.
Leave a comment
on 2010-01-30 19:45 *
By stuartsierra
(In revision:3275810556b075ff9a3a0abc0d08b3a19ee46bae) pprint: Move gen-class expressions to separate file; refs #65
To avoid order-of-compilation issues,
this patch puts the gen-class expressions
for ColumnWriter and PrettyWriter in a
separate file, rather than in the ns
declarations.
Branch: master
To avoid order-of-compilation issues,
this patch puts the gen-class expressions
for ColumnWriter and PrettyWriter in a
separate file, rather than in the ns
declarations.
Branch: master
on 2010-01-30 19:49 *
By stuartsierra
(In revision:aa34fb9e52fa500c99bb45448bdfcd4020db5392) Reenable compiling of test namespaces in POM; refs #65
But disable tests of pprint, which fail currently
Branch: master
But disable tests of pprint, which fail currently
Branch: master
I think I have fixed this by placing the gen-class directives in a separate file; only that file will be AOT-compiled.
on 2010-01-30 20:05 *
By tomfaulhaber
What a mess! This seems like a big problem with gen-class if we have to jump through this many hoops to make it work once we have more than one class in a hierarchy.
Of course it worked fine back in ant-land where we had control over the compilation order.
Of course it worked fine back in ant-land where we had control over the compilation order.
on 2010-01-30 21:50 *
By stuartsierra
It's not that bad. The Ant build script was messier. This is more flexible, because it only AOT-compiles things that need it, i.e. gen-class.
on 2010-01-31 08:33 *
By Chas Emerick
I mentioned this elsewhere, but perhaps there's a reason why this isn't workable in this case: I believe if you require clojure.contrib.pprint.ColumnWriter in PrettyWriter's ns declaration (perhaps before the :gen-class form?), then the compiler will visit and gen CW before attempting to gen-class PW.
This would eliminate the need to explicitly specify which namespaces to compile.
This would eliminate the need to explicitly specify which namespaces to compile.
on 2010-01-31 08:50 *
By stuartsierra
Tried it. Didn't work.