[bitc-dev] Error in specification of DO
devbox at selnet.org
Wed Jul 9 14:35:07 CDT 2008
On 09/07/2008, at 11.31, Jonathan S. Shapiro wrote:
>I have just realized that the specification of DO is not what we wanted.
>I followed the Scheme specification of DO here. You will find on the web
>statements in various places that Scheme DO implements DO-UNTIL. Those
>statements are incorrect. What Scheme DO implements is in fact
>WHILE-NOT. That is: a Scheme DO loop may not perform any executions of
>the body at all.
>I tend to believe that there are good uses for all of the following
> WHILE perform body while test remains true
> WHILE-NOT perform body while test remains false
> DO-UNTIL perform body until test becomes true, running at least
>Of the three, I believe that WHILE-NOT is the least commonly useful, and
>that it is trivially subsumed by WHILE.
This is exactly what Pascal does, WHILE executes the body zero or more
times, DO-UNTIL executes the body one or more times.
Pascal does not provide WHILE-NOT directly, it is written as:
WHILE (NOT <condition>)
>I am therefore inclined to remove DO from the specification, replacing
>it with WHILE and UNTIL, each having the obvious canonical rewritings.
>bitc-dev mailing list
>bitc-dev at coyotos.org
More information about the bitc-dev