[Python-Dev] 308: the debate is petering out
Samuele Pedroni
pedronis@bluewin.ch
Wed, 19 Feb 2003 08:02:58 +0100
There were a group of people that would find
a when C else B
with 'when' instead of 'if' less confusing than 'a if C else b'.
The alternative (as in Haskell, ML,...):
if C then a else b
was also mentioned a few times.
For the rest I think we have all reasonable contenders.
----- Original Message -----
From: "Raymond Hettinger" <python@rcn.com>
To: "Guido van Rossum" <guido@python.org>; <python-dev@python.org>
Sent: Wednesday, February 19, 2003 2:40 AM
Subject: Re: [Python-Dev] 308: the debate is petering out
> > Raymond, have any new proposals been suggested and not shot down?
>
> Someone re-proposed c ? a else b. Their rationale is that the ? is a better
> marker than "then" and is suggestive enough to not need a leading "if";
> it doesn't require a new keyword and does not overload the colon.
> No one shot this down but it didn't generate any real support either.
>
> There was an interesting, weird, and fruitless discussion on how
> "c then a else b" could be implemented as a pair of binary operators
> that are not required to be used together.
>
> There was a rapidly shot down idea to use bool.choose(a, b) where
> choose() was a special method that could somehow implement
> lazy evaluation of its arguments.
>
> A recent proposal is: (? <cond1>: <expr1>, <cond2>: <expr2>, <default> ?).
> There have only been a few hours for comment. Though the visual
> cues are there, my issue with it is that the colon usage is likely to confuse
> anyone exposed to the c?a:b form in other languages where the colon
> separates the alteratives rather than the condition and alternative.
>
>
> Raymond Hettinger
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev