Promoting Python

Marko Rauhamaa marko at pacujo.net
Wed Apr 6 10:14:13 EDT 2016


Michael Selik <michael.selik at gmail.com>:

> On Wed, Apr 6, 2016, 12:51 PM Marko Rauhamaa <marko at pacujo.net> wrote:
>
>> Really, there's only one high-level construct you can't live without:
>> the "while" statement. Virtually every Python program has at least
>> one "while" statement, and in general, it is unavoidable.
>>
>> Basic programs, on the other hand, don't need that meaningless
>> buzzword, but can live just fine with GOTO.
>
> You don't need WHILE or GOTO, you can just copy-paste code. You
> probably need an IF at some point.

Seriously, Python wouldn't be, couldn't be Turing-complete without
"while" (mainly because it doesn't support tail-recursion elimination).

Now, if Python had an unlimited range() iterator/iterable, you could use
a "for" statement to emulate "while".

As it stands, Python without "while" could only compute
primitive-recursive functions. However, you only need "while" a maximum
of one time in your whole program to perform an arbitrary computation.


Marko



More information about the Python-list mailing list