From: Alex M. <kil...@ne...> - 2004-09-29 00:46:16
|
hello i want to try to use ABCL for some web development. as i understand, java frameworks for webdev will need a servlet-class. so i'll need to wrap some lisp functions in a class. are there working methods in ABCL to do this? i've tried jnew-runtime-class: CL-USER(3): (java:jnew-runtime-class "org.ultra.Klr1" "java.lang.Object" () () `(("choff" "java.lang.String" () ,(lambda (this) "helo"))) ()) T it created class Klr1, but it didn't have choff method: CL-USER(4): (jcall (jmethod "org.ultra.Klr1" "choff") (jnew (jconstructor "org.ultra.Klr1")) (make-immediate-object t :boolean)) Debugger invoked on condition of type ERROR: no such method: choff that class only has methods: ("hashCode" "getClass" "wait" "wait" "wait" "equals" "notify" "notifyAll" "toString") i've also tried jfli-abcl, but it refused to work as is (my best run is to the point when it says it cannot find asm lib - that's ok since there's really no asm lib in classpath, however to reach this point i have to compile and load it - each time i run it i have to compile.. i think it's not ok - possibly something with eval-when..). by the way, asm-1.5.1 is not compatible with jnew-runtime-class - they changed parameters for visit function.. i used asm-1.4.3. i've also seen function jinterface-implementation - can it help me? with best regards, Alex 'killer_storm' Mizrahi. |
From: Andras S. <as...@ma...> - 2004-09-29 06:02:05
|
On Wed, 29 Sep 2004, Alex Mizrahi wrote: > hello > > i want to try to use ABCL for some web development. as i understand, java > frameworks for webdev will need a servlet-class. so i'll need to wrap some > lisp functions in a class. > are there working methods in ABCL to do this? > > i've tried jnew-runtime-class: Yes, this is it. > > CL-USER(3): (java:jnew-runtime-class "org.ultra.Klr1" "java.lang.Object" () > () `(("choff" "java.lang.String" () ,(lambda (this) "helo"))) ()) > T > > it created class Klr1, but it didn't have choff method: Try (java:jnew-runtime-class "org.ultra.Klr1" "java.lang.Object" () () `(("choff" "java.lang.String" () ,(lambda (this) "helo") "public")) ()) so choff will be public. > > i've also tried jfli-abcl, but it refused to work as is (my best run is to > the point when it says it cannot find asm lib - that's ok since there's > really no asm lib in classpath, however to reach this point i have to > compile and load it - each time i run it i have to compile.. i think it's > not ok - possibly something with eval-when..). From your other mail I gather that your asm problems are mostly gone. Is that right? jfli's NEW-CLASS macro is much more convenient than JNEW-RUNTIME-CLASS. > by the way, asm-1.5.1 is not compatible with jnew-runtime-class - they > changed parameters for visit function.. i used asm-1.4.3. Yes, Adam Warner pointed this out to me on c.l.l. I'll check in a fix to runtime-class.lisp later today. > > i've also seen function jinterface-implementation - can it help me? > Probably not - it's for implementing interfaces (via proxies). Andras |