[Python-Dev] Wishlist: dowhile

Andrew Koenig ark-mlist at att.net
Wed Jun 15 14:52:32 CEST 2005


> > I believe that Algol 68 loops looked like the following (in somewhat
> > more Python-like terms):
> >
> > 	[for <identifier> [from <suite>] [step <suite>] to <suite>]
> > 	[while <suite>]
> > 	do <suite> od


> As far as I remember, it was:

> do
> 	<suite>
> while <suite; ending with a boolean value>
> 	<suite>
> od

> It might be that this could be preceded by a 'for' clause, but memory
> fails me there.

To be completely sure, I dug out my copy of the "Informal Introduction to
Algol 68" by Lindsey and van der Meulen.  This book is the official Algol 68
tutorial book.  It describes the "loop clause" as follows:

	for
		some int identifier, which is hereby declared
	from
		some meek int unit
	by
		some other meek int unit
	to
		a third meek int unit
	while
		a meek bool enquiry-clause
	do
		a void serial-clause
	od

where any of these keywords and its sequel can be omitted, except for "do"
or "od".

Here, the term "meek" refers to how aggressively the compiler should try to
convert the result to int; it specifies, for example, that if after "from"
you write the name of a procedure without arguments, that procedure will be
called instead of using the procedure itself as a starting point (which
would be nonsensical).

	



More information about the Python-Dev mailing list