while (a=b()) ...

Greg Ewing greg.ewing at compaq.com
Thu May 13 18:36:19 EDT 1999


"Evan Simpson" <evan at tokenexchange.com> writes:

| This has been suggested (and Guido has said that he might well put it
in) as
| "and while"
|
| while 1:
|   value = getValue()
| and while value:
|   process(value)

I've been thinking for quite a while about how best to 
phrase such a construct so as to minimise mangulation
of English, and so far my best effort is:

  while:
    <suite>
  gives <bool-expr>:
    <suite>

for example:

  while:
    line = f.readline()
  gives line <> "":
    frobulate(line)

Requires a new keyword... maybe in Python 2?

Greg




More information about the Python-list mailing list