<div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">If the ability to capture a subexpression is given up on, then we are are down to</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">just capturing the value of the predicate in if statements. In loops, it is only the</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">predicate and iteration index.</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">If you mashup `if` and `def`, you end up with this mess:</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    if get_something() def (value):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        do_something(value)</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">And `while` and `def` is no prettier:</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    while get_something() def (value, index):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        do_something(value)</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">Both ugly, and totally misleading, but being able to accept the values as params is</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">nice, and the parenthesis </font><font color="#000000" face="verdana, sans-serif">make things clearer and more Pythonic IMO, so </font><span style="color:rgb(0,0,0);font-family:verdana,sans-serif">maybe</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:verdana,sans-serif">just use `as` but require the </span><span style="color:rgb(0,0,0);font-family:verdana,sans-serif">names be parenthesised: </span></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    if predicate as (value):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        use(value)</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    while predicate as (value, index):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        use(value)</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">The next options may be a bit too functional-looking, when the suite is not a function</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">body, but I thought they read better:</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    while predicate pass (value, index):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        use(value)</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    if predicate -> (value):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        use(value)</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace"><br></font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">    while predicate yield (value, index):</font></div><div class="gmail_default"><font color="#000000" face="monospace, monospace">        use(value)</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">The main idea is to reuse comma separated params in parens to make the assignment</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif">clearer and to look more like the `def` and `class` grammar.</font></div><div class="gmail_default"><font color="#000000" face="verdana, sans-serif"><br></font></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace">-- Carl Smith</font></span><br></div></div><div><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace"><a href="mailto:carl.input@gmail.com" target="_blank">carl.input@gmail.com</a></font></span></div></div></div></div></div></div>
<br><div class="gmail_quote">On 21 May 2018 at 22:37, Carl Smith <span dir="ltr"><<a href="mailto:carl.input@gmail.com" target="_blank">carl.input@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">Chris makes a lot of good points regarding *which* languages to look at, but</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">it seems like that line of enquiry is unlikely to suggest anything more than it<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">has so far, especially if we're limiting it to languages everyone has heard of.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">They either use a keyword, an operator, don't support the feature or they're</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">wacky.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">If anything, the survey says we need to think outside the box.</div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div></font></span></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-3987396724770074080gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace">-- Carl Smith</font></span><br></div></div><div><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace"><a href="mailto:carl.input@gmail.com" target="_blank">carl.input@gmail.com</a></font></span></div></div></div></div></div></div></font></span><div><div class="h5">
<br><div class="gmail_quote">On 21 May 2018 at 20:11, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, May 22, 2018 at 2:43 AM, Mike Miller <<a href="mailto:python-ideas@mgmiller.net" target="_blank">python-ideas@mgmiller.net</a>> wrote:<br>
> To clarify there were three main criteria, and one minor.  Newer,<br>
> popular/becoming industry standard, and designed to address shortcomings in<br>
> previous generations.  Finally, the limit of my energy when already working<br>
> on a project.<br>
<br>
</span>Note how not one of your criteria says that the language has to have<br>
made the right choice - only that it's made a DIFFERENT choice to<br>
languages in a previous generation. So you're heavily selecting in<br>
favour of languages that say "hey look, we know better than everyone<br>
else does", without actually proving that it's better. There's no<br>
shortage of language designers who say "oh look how terrible C is",<br>
and when a language designer has a lot of clout behind him (like "apps<br>
for this new mobile phone should be written using this language"), it<br>
can get extremely popular among people who don't actually have much<br>
choice of language - and certainly don't have the option to use C.<br>
<br>
Much more useful would be to look at languages that (a) work in a<br>
field where programmers have ample freedom to choose between<br>
languages, and (b) have been around long enough to actually<br>
demonstrate that people want to use them. Look through the Stack<br>
Overflow Developer Survey's report on languages:<br>
<br>
<a href="https://insights.stackoverflow.com/survey/2018/#most-loved-dreaded-and-wanted" rel="noreferrer" target="_blank">https://insights.stackoverflow<wbr>.com/survey/2018/#most-loved-<wbr>dreaded-and-wanted</a><br>
<br>
A "Wanted" language is one that many developers say "I don't currently<br>
use, but I would like to". (It may also be a language that has<br>
murdered semicolons. I believe the bounty on JavaScript's head is<br>
quite high now.) Go through that list and you'll get an idea of what<br>
people wish they could use; then toss out anything that hasn't been<br>
around for at least 10 years, because there's a tendency for new<br>
technologies to be over-represented in a "Wanted" listing (partly<br>
because fewer programmers already know them, and partly because people<br>
want to try the latest toys). That may give you a better list of<br>
languages to compare against.<br>
<br>
ChrisA<br>
<div class="m_-3987396724770074080HOEnZb"><div class="m_-3987396724770074080h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>