Re: Iteration with named let

Subject: Re: Iteration with named let
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Wed, 25 Jun 1997 11:44:47 -0500
At 10:13 AM 6/25/97 BST, Henry S. Thompson wrote:
>There is at least an infelicity in your style, at worst a bug, which
>given your gracious willingness to be coached I'll tackle -- usually
>in let loops you do the loop check at the top:
>
>(let loop ((desc-list (children %element%)))
>     (if (node-list-empty? desc-list)
>	 #f
>       (or (equal? (gi (node-list-first desc-list))
>		   %gi%)
>	   (loop (node-list-rest desc-list)))))
>
>Your code as written asks for the gi of the empty-node-list in any
>non-matching case, including the case where %element% had no children,
>which probably won't cause an error, but only for pretty subtle
>reasons, whereas the above recasting of it doesn't do that, and will
>will handle the no-children case cleanly.

In fact, it did cause an error.  I now see the error of my ways.  I'm more
than willing to be coached (in part because I assume that others have the
same questions and will benefit from any answers).

I have also come to appreciate Paul's recommendation for formatting closing
parens.

Thanks for everyone's help--I now have a very nice HTML version of HyTime.
If you're interested in the result, it can be reviewed at the temporary
location "www.drmacro.com/hythtml/is10744r.html".  This copy is for review
purposes only and does not replace the printed version of the standard,
which will be published as soon as ISO gives us the publication date.

Cheers,

Eliot 

 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread