Creating closures in methods

Kjetil S. Matheussen k.s.matheussen@notam02.no
Thu Feb 1 23:16:00 GMT 2007


Is the following supposed to work?

"
(define (external-func func)
   #f)
(define-simple-class <test> ()
   (var 50)
   ((*init*)
    (external-func (lambda ()
 		    var))))
(define test (<test>))
"


Because it doesn't for me. I couldn't find anything in the documentation 
about this either.


Error is:
"
java.lang.VerifyError: (class: test, method: <init> signature: ()V) 
Expecting to find object/array on stack
 	at java.lang.Class.getDeclaredMethods0(Native Method)
 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
 	at java.lang.Class.getDeclaredMethods(Class.java:1763)
"



More information about the Kawa mailing list