<div dir="auto">It was a long time ago I couldn't easily find the post but that's alright, you refreshed the idea :)<div dir="auto"><br></div><div dir="auto">Let's see what others think of for x =</div><div dir="auto"><br></div><div dir="auto">I also remembered some languages (like lua) use for x = range (5) interchangeably with for x in range (5) and guido said it will never make such a thing, for .. in being the iteration.</div></div><br><div class="gmail_quote"><div dir="ltr">Le jeu. 24 mai 2018 à 18:22, Alexander Belopolsky <<a href="mailto:alexander.belopolsky@gmail.com">alexander.belopolsky@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, May 24, 2018 at 12:04 PM Robert Vanden Eynde <<a href="mailto:robertve92@gmail.com" target="_blank" rel="noreferrer">robertve92@gmail.com</a>> wrote:<br></div><div dir="ltr"><br></div><div dir="ltr">> This idea was mentioned (by me) at a time yes, but wasn't written in the document. </div><div dir="ltr"><br></div><div>Can you point me to a specific post?  There were so may that I must have missed that one.</div><div dir="ltr"><br></div><div dir="ltr">> I think one of the thing was that it would make the grammar non LL1 because when seeing the token "for" in a list comprehension it wouldn't know in advance if it's the loop or the assignment.</div><div><br></div><div>I don't see how that can be a problem.  From the grammar point of view, "for" in "for var = <expr>" may still be seen as introducing a "loop", but when "=" is seen in place of "in", the compiler will resize that the "loop" is one a single value and emit efficient code for it.  At the AST level,   "for var = <expr>"  will look exactly the same as  "for var in <expr>" only with an "=" instead of "in".</div><div><br></div><div>> And also, it might confuse people because 'for' is for iteration.</div><div><br></div><div>I think I addressed this in my previous post.  Yes, for people with a C/C++ background, "for" may be too strongly associated with loops, but in mathematical sense, it seems clear that "for var in a set" means iteration over a set, while "for var = expression" means binding to a single value.</div></div></div>
</blockquote></div>