for / while else doesn't make sense

Chris Angelico rosuav at gmail.com
Wed Jun 15 09:56:14 EDT 2016


On Wed, Jun 15, 2016 at 11:51 PM, Random832 <random832 at fastmail.com> wrote:
> if(x) true_body; else false_body;
>
> is syntactic sugar for:
>
> if(!x) goto else;
> true_body;
> goto end;
> else: false_body;
> end: ;

And I remember writing GW-BASIC code like this, because we didn't have
block if. You could put a single statement after an if, but for
anything bigger than that, it was "negate the condition and GOTO the
bit after".

ChrisA


More information about the Python-list mailing list