I found some corrections to make in my IKVM example from the other day...
For the record there is no need to generate mscorlib.jar and add it to the classpath. The point was to coerce ikvm to reference and load mscorlib.dll, but ikvm being a .NET program obviously already references mscorlib and loads it at runtime. However, the technique of adding a stub jar to the ikvm classpath is correct for making your own assemblies or other framework assemblies available to clojure. Make the stub, add it to your classpath, and you're ready to import from cli.*. (IKVM requires the cli. to prevent namespace clashes between .NET and Java classes.)
Aside: The jar stub generation step is also necessary if you want to import .NET classes into Java sources which you then compile with javac and run with ikvm. The stub jar has to be there for javac to make sense
of things when compiling your sources. Then when you compile your jar to .NET, ikvmc sees the stub dependency and swaps in a reference to the actual .NET assembly. .NET, Java, and Clojure all in one app? That's getting a little complicated... but clojure and IKVM make it easy if you want to do it!
There's one technique that requires no stub generation. When you compile clojure.jar to clojure.exe (or clojure.dll) with ikvmc, you can use a command line switch to add a reference to a .NET assembly. No stub jar is needed, and in clojure the import cli.* calls work as before. For example:
# ikvmc -reference:RunManager.dll clojure.jar
Note IKVMC0004: using main class "clojure.lang.Repl" based on jar manifest
Note IKVMC0002: output file is "clojure.exe"
# clojure.exe
Clojure
user=> (import '(cli.Xia.AlphaGui.RunManager HandelWrapAlpha))
nil
user=> (. HandelWrapAlpha GetHandelAlpha)
Xia.AlphaGui.RunManager.HandelWrapAlpha
This is cool because the ikvmstub step isn't needed, but it is admittedly less dynamic than just tweaking the classpath.
Shawn