This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Creating closures in methods
- From: Per Bothner <per at bothner dot com>
- To: "Kjetil S. Matheussen" <k dot s dot matheussen at notam02 dot no>
- Cc: kawa at sources dot redhat dot com
- Date: Fri, 02 Feb 2007 00:03:17 -0800
- Subject: Re: Creating closures in methods
- References: <Pine.LNX.4.64.0702020009170.9140@ttleush>
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/