if the else short form

NevilleDNZ nevillednz at gmail.com
Sat Oct 9 09:04:41 EDT 2010


On Oct 9, 6:55 pm, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <i8o1ij$ro... at news.eternal-september.org>, BartC wrote:
>
> > "NevilleDNZ" <neville... at gmail.com> wrote in message
> >news:ad9841df-49a1-4c1b-95d0-e76b72df64eb at w9g2000prc.googlegroups.com...
>
> >> In Algol68 this would be:
> >> x:=(i|"One","Two","Three"|"None Of The Above")
>
> > The point is, the construction works well when the syntax fully supports
> > it.
>
> But note that Algol68 doesn’t support explicit labels on the alternatives
> in a case expression or statement. That idea came later.

Good point... I do ponder why (given that linked lists can easily be
created in Algol68) useful types like LIST and DICT were left out of
the standard prelude.  I do not recall any conversation about this in
the "ALGOL Bulletins" /* I can reasonably guess why C elected to
excluded these types */

The nearest to "explicit labels" in Algol68 would be:
STRING x:=(i=0|"Zero" |:i=1|"One" |:i=2|"Two" |:i=3|"Three" |"None Of
The Above");

Basically a compound IF statement... effectively a read only, compile-
time dictionary.

N





More information about the Python-list mailing list