Subject: Re: Iteration...
From: (Rob Warnock)
Date: 28 Mar 2001 03:02:37 GMT
Newsgroups: comp.lang.scheme
Message-ID: <99rk8d$4nnnv$>
<> wrote:
| can anyone tell me if there are instinaces  in scheme where you can
| have multiple exit points of an iterative loop?
| can anyone show me how to code this?

Yes, and yes. The "named let" construct is ideally suited to that.
See the second half of <URL:
R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.2.4> for a example. Note that the
use of a "cond" inside the named-let is quite common, and that any
branch of the cond which *doesn't* (tail-)recursively call the named-let
procedure is an "exit" of the loop, thus providing an arbitrary number
of distinct exit cases.


Rob Warnock, 31-2-510
SGI Network Engineering		<URL:>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA