[armedbear-devel] [PATCH] Loading Lisp from JAR Files

Alessio Stalla alessiostalla at gmail.com
Wed Aug 26 12:55:09 UTC 2009


On Wed, Aug 26, 2009 at 2:43 PM, Mark Evenson<evenson at panix.com> wrote:
> Attached is a patch that allows LOAD to work on arbitrary JAR files.  It
> uses the semi-official ([according to Wikipedia][1] and as implemented in
> java.net.URL) URI Schema:
>
>        jar:file:PATH!/JAR_ENTRY
>
> where "file:PATH" is a filepath URI (meaning that absolute pathnames need to
> have a double leading slash, i.e. '//var/tmp/foo.jar'), and JAR_ENTRY is the
> path in the jar file.

Looks nice. One piece of advice, if it can be useful to you: since the
file:PATH part is an URL, you could use URL.openStream combined with
ZipInputStream: that way all the quirks about paths on different OSes,
URL-encoded characters, and the like would be handled automatically by
the Java standard library.

Also, how does this patch behave with recursive loading - i.e. I load
x from file.jar and x contains (load "y"), is "y" relative to x?

Alessio




More information about the armedbear-devel mailing list