A Summary: Expression-Assignments. (Very Long)

Darrell news at dorb.com
Wed May 12 16:15:40 EDT 1999


> 3. Allow test-in-the-middle loops
>
> Code would look like:
>
> do:
> line=sys.stdin.readline()
> while line:
> sys.stdout.write(line)
>
> A variant syntax suggested (and claimed to be endorsed by the Guido) is
> ``and while'', a distant cousin of ``else if''
>
> while 1:
> line=sys.stdin.readline()
> and while line:
> sys.stdout.write(line)
>

Forth has something like this.
begin .... while .... repeat






More information about the Python-list mailing list