This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Verifier error using define-simple-class


Hi Dominique,

Thanks for pointing this out and for the workaround.

Dean

Dominique Boucher wrote:
Hi,

A bug is already open regarding a similary issue (#4881) on Savannah. A here
is simple work-around: when accessing fields or calling methods in a
lambda-expression inside the body of a method, I usually wrap the whole
method body with (let ((self (this))) ..):

(define-simple-class <A> ()
   ((workaround)
    (let ((self (this)))                 ; <-----
      (let ((fn (lambda (o)
                  (invoke self 'get-identity-property-name o))))    ; <-----
         fn)))
   ...
   ((get-identity-property-name property-name)
    (string-append property-name "Identity")))


Suggestion: maybe Kawa could do this automatically (or something similar), so that a 'self' variable is always visible in method bodies?

Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]