This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: More tagbody
- From: Per Bothner <per at bothner dot com>
- To: Are Meisfjord <are at meisfjord dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Wed, 02 Apr 2003 15:27:06 -0800
- Subject: Re: More tagbody
- References: <290190-2200343223105914@meisfjord.com>
Are Meisfjord wrote:
(define (test)
(let ((val '()))
(try-catch
(letrec ((start (lambda ()
(set! val 1)
(point-a)
(throw (make <java.lang.RuntimeException>))
(set! val (+ val 16))
(point-c)))
This doesn't make sense - why the set! and point-c call after
the throw?
As you can see I get away with at most one exception thrown per
tagbody (any suggestions on how to get rid of it?)
I suspect you'll have to do some Java coding. Basically, you
want to have the code expand to a BlockExp/ExitExp, possibly
after optimization. The easiest might be to implement
the CommonLisp block and return-from forms, which map
pretty directly into BlockExp and ExitExp. If there is
some similar form in some Scheme implementation, that
might be better.
--
--Per Bothner
per at bothner dot com http://per.bothner.com/