"as" == Alessio Stalla alessiostalla@gmail.com writes:
as> The other solution, maybe less optimal but much easier imho, is to as> expose the api for loading files from jars and integrate it with LOAD as> (that is, with Lisp pathnames), and maybe provide a nice function to as> package a bunch of compiled Lisp files (say, from a given directory) as> into a jar to be deployed together with abcl.jar. I haven't thought as> about this in depth so there might be conceptual problems, I don't as> know. But if it can be done, it's not hard to do.
I've had a first stab at doing this; it works OK in light testing.
To compile files to a zip file (existing functionality in ABCL), do
(let ((sys::*compile-file-zip* t)) (compile-file "foo.lisp" :output-file "/tmp/foo.jar"))
To load from that jar, apply the attached patch and use
(load "jar:file:/tmp/foo.jar!/foo")
You can bundle your compiled files with ABCL in a single jar and load directly from that (you'd need to fiddle with "getResource" to know your home jar filename; possibly we should set EXT:*LISP-HOME* to that when running from a jar).