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
>constructs:
>
>  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
>              once.
>
>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.
>
>Objections?

None.

>
>
>shap
>
>_______________________________________________
>bitc-dev mailing list
>[email protected]
>http://www.coyotos.org/mailman/listinfo/bitc-dev



_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to