On Tue, Apr 27, 2010 at 8:24 AM, Mark Evenson evenson@panix.com wrote:
On 4/27/10 4:05 AM, Alan Ruttenberg wrote:
[…]
Now I'm getting used to the new pathname code and other changes.
- I used to use probe-file to test whether a thing was a file. Now,
however, probe-file on an http URI will return true. Is there a recommended way to see whether a pathname is a file pathname?
URL-PATHNAME and JAR-PATHNAME are now subtypes of PATHNAME, so the usual CL type machinery should be at your disposal. For convenience, we have defined predicate functions EXT:PATHNAME-URL-P and EXT:PATHNAME-JAR-P which is what I would expect one for common usage.
- I use a different classloader (from bsh) so as to be able to add
jars to my classpath dynamically. However, if I wanted to specialize a method on a java class so obtained, I need to coerce it to one that clos knows about. I was using an internal call to do so:
(#"findJavaClass" 'org.armedbear.lisp.JavaClass class)
However this is gone in the new version. Could you suggest how I can register a java class that I've obtained from the alternative class manager so that clos knows about it?
Hmmm, this should be unrelated to the URL pathname implementation.
JavaObject.java seems to still have a findJavaClass() method, and even provides a Lisp interface JAVA::%FIND-JAVA-CLASS. Maybe JSS is failing to properly invoke the method?
In any case, we should figure out what functionality you need here, and polish this up as a semi-supported interface Lisp-side for usage. The first step is figuring out where (and then why) we changed this.
IIRC, I should have a local patch to make JCLASS use another classloader if you pass it to it, including in CLOS method specializers, as in (defmethod foo ((x (jclass "foo" *my-classloader*))) ...)
If that sounds sensible to you, I can adapt it to the current version of abcl and commit it, so it can be tested.
Ciao, Alessio