[bitc-dev] Error in specification of DO

Jonathan S. Shapiro shap at eros-os.com
Wed Jul 9 10:31:51 CDT 2008


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.

I am therefore inclined to remove DO from the specification, replacing
it with WHILE and UNTIL, each having the obvious canonical rewritings.

Objections?


shap



More information about the bitc-dev mailing list