Re: Re: New wiki account
| From: | Nikita Popov | Date: | Fri, 11 May 2012 10:21:11 +0000 |
| Subject: | Re: Re: New wiki account | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60532@lists.php.net to get a copy of this message | ||
On Fri, May 11, 2012 at 8:33 AM, Alexander Moskaliov <irker@irker.net> wrote:
> I think the main idea of this RFC: Run the code, if we had never entered
> in loop.
> In this case more sence to change "for .. else" condition to this:
> If second expression is equal FALSE before looping(but after run first
> expression of course), we run "else" code.
>
> By example:
> for (exp1;exp2;exp3) {
> exp4;
> } else {
> exp5;
> }
Python already uses the for .. else syntax, but with different
semantics: In Python the else clause is only executed, if the loop
isn't left using break. See this article for more info:
http://psung.blogspot.de/2007/12/for-else-in-python.html
Thus I'm not sure that it really makes sense for us to introduce this
syntax with a completely different meaning.
Nikita