This is the mail archive of the kawa@sourceware.org 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: Creating closures in methods


Kjetil S. Matheussen wrote:

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>))
"

Yes. I took a look at it. The problem was that initialization was being done in the wrong order. It wasn't too hard to fix (mainly trying to reconstruct what part of the code does what), but then I started playing with the test-case and found a couple of other things to fix too.

I checked in the fix, along with a test-case based on your
original test-case.  Congratulations: your name is now
in testsuite/ChangeLog.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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