do...until wisdom found...

Dale Strickland-Clark dale at out-think.NOSPAMco.uk
Tue Apr 17 10:28:54 EDT 2001


"Ken Peek" <Peek at LVCM.comNOSPAM> wrote:

>Can anybody think of a good name for a "Python-like" new language for small
>embedded processors?
>Let's see-- "tinyPython"?  nope-- has "Python" in it-- might make Guido mad.
>Hmmm, maybe "Dragon"?  Probably used by someone else?  Hmmm... maybe ???
>
>Any ideas?
>
>

How about, for "execute at least once":

REPEAT:
	code
	WHILE condition

REPEAT:
	code
	UNTIL condition

DO doesn't imply repition and only seems to have appeared to help parsers find the start of a block.

If the WHILE/UNTIL clause is missing, the loop must be terminated by a BREAK or other means.

Furthermore, while we're on the subject, I prefer:

WHILE condition:
	code
	REPEAT

UNTIL condition:
	code
	REPEAT

Python-like syntax with the colon at the start of a block avoids the ambiguity you might otherwise
produce with the same keyword being used at the start or end of a loop.

The REPEAT clause could be optional here so the WHILE is as in Python now. 

I think WHILE and UNTIL should always both be available.

WHILE 1 is ugly and implies that a pointless test being made - although one hopes this is optimised
out.

As for a name, how about Monty? If you later produce an expanded syntax you could call that the Full
Monty.


--
Dale Strickland-Clark
Out-Think Ltd
Business Technology Consultants



More information about the Python-list mailing list