From: Leigh [mailto:lei...@gmail.com] Sent: Friday, September 19, 2014 11:57 PM
Traditionally this is requested as a loop {} else {} structure,
however due to the choice of keyword this causes significant BC
problems.
I have written an RFC presenting this feature as loop {} or {} along
Hey:
On Sat, Sep 20, 2014 at 5:56 AM, Leigh lei...@gmail.com wrote:
Hello list!
This is an item that has been repeatedly requested in various forms,
with no solid implementation to back it up, yet remaining quite
desirable to the developer community at large.
Loops with a default block,
On 22 September 2014 08:17, Christian Stoller stol...@leonex.de wrote:
I like this proposal as I am using this feature in Twig very often.
But I would really prefer using else instead of or, because it
is already common in the mentioned projects.
Maybe you could reconsider if it is really not
On 22 September 2014 08:49, Xinchen Hui larue...@php.net wrote:
Maybe I am too conservative. I don't like this idea. :
And I DO THINK, we should try to stop brings lots of new things into PHP7.
I am worring whether it can be release in the next year
Can you give some more
On 2014-09-21 02:21, Sara Golemon wrote:
On Sat, Sep 20, 2014 at 3:03 PM, Leigh lei...@gmail.com wrote:
On 20 September 2014 20:47, Sara Golemon p...@golemon.com wrote:
I like the general idea, but rather than explicitly focusing on
the 'or' keyword, how about just giving all loop constructs
Am 21.09.2014 02:22 schrieb Sara Golemon poll...@php.net:
It would also mean having to make { default block } into an
expression... with a return value (to be allowed on either side of the
boolean or)
Excellent point, a block only works with T_OR if it has a value. I'm
pretty sure that
On 20 September 2014 01:02, Rowan Collins rowan.coll...@gmail.com wrote:
It seems like there are actually quite a number of special blocks you
*could* define, such as:
a) When the body is executed zero times (proposed or block)
b) When the body is executed exactly once (in a do...while loop,
On 20 September 2014 15:43:46 GMT+01:00, Leigh lei...@gmail.com wrote:
On 20 September 2014 01:02, Rowan Collins rowan.coll...@gmail.com
wrote:
It seems like there are actually quite a number of special blocks you
*could* define
Some or all of these can be implemented (in other RFCs).
However
On Sep 19, 2014, at 14:56, Leigh lei...@gmail.com wrote:
https://wiki.php.net/rfc/loop_or
I like the general idea, but rather than explicitly focusing on the 'or'
keyword, how about just giving all loop constructs (do/while/for/foreach) a
return value? I'd suggest an integer return value
On 20 September 2014 20:47, Sara Golemon p...@golemon.com wrote:
I like the general idea, but rather than explicitly focusing on the 'or'
keyword, how about just giving all loop constructs (do/while/for/foreach) a
return value? I'd suggest an integer return value indicating the number of
On 20 September 2014 23:06, Leigh lei...@gmail.com wrote:
Lots to think about here, if it's at all viable this will need it's
own separate RFC, it's a much more invasive change, but definitely a
great idea.
NikiC and Bob have convinced me to carry on with the original
proposal, and bring up
On Sat, Sep 20, 2014 at 3:03 PM, Leigh lei...@gmail.com wrote:
On 20 September 2014 20:47, Sara Golemon p...@golemon.com wrote:
I like the general idea, but rather than explicitly focusing on the 'or'
keyword, how about just giving all loop constructs (do/while/for/foreach) a
return value?
On Sat, Sep 20, 2014 at 5:16 PM, Leigh lei...@gmail.com wrote:
On 20 September 2014 23:06, Leigh lei...@gmail.com wrote:
Lots to think about here, if it's at all viable this will need it's
own separate RFC, it's a much more invasive change, but definitely a
great idea.
NikiC and Bob have
Hello list!
This is an item that has been repeatedly requested in various forms,
with no solid implementation to back it up, yet remaining quite
desirable to the developer community at large.
Loops with a default block, executed in the event that the loop is
never entered.
On 19/09/2014 22:56, Leigh wrote:
Hello list!
This is an item that has been repeatedly requested in various forms,
with no solid implementation to back it up, yet remaining quite
desirable to the developer community at large.
Loops with a default block, executed in the event that the loop is
On 19 September 2014 23:08, Rowan Collins rowan.coll...@gmail.com wrote:
It's worth noting that both Smarty and Twig implement a similar mechanism in
their respective foreach loop syntax.
Smarty spells it {foreachelse}
http://www.smarty.net/docs/en/language.function.foreach.tpl
Twig spells
On 19 Sep 2014, at 22:56, Leigh lei...@gmail.com wrote:
Loops with a default block, executed in the event that the loop is
never entered.
https://wiki.php.net/rfc/loop_or
While this might be useful, I’d prefer we copy Python’s else behaviour, where a
block of code is executed when break
On 19 September 2014 23:47, Andrea Faulds a...@ajf.me wrote:
While this might be useful, I’d prefer we copy Python’s else behaviour, where
a block of code is executed when break is never used. This feature makes code
that does, for example, a linear search nicer to read.
--
Andrea Faulds
On 20 Sep 2014, at 00:10, Leigh lei...@gmail.com wrote:
I understand the desire for something python-like, however it
certainly doesn't fall under the or keyword.
Why not? Python uses “else”, and before creating this RFC you initially wanted
to use “else”.
If anything we could
probably
On 20 September 2014 00:15, Andrea Faulds a...@ajf.me wrote:
Why not? Python uses “else”, and before creating this RFC you initially
wanted to use “else”.
Then I realised it was folly. Documented in the RFC why else is a bad choice.
I’m bringing it up because I think we’re only going to end
On 19/09/2014 23:47, Andrea Faulds wrote:
On 19 Sep 2014, at 22:56, Leigh lei...@gmail.com wrote:
Loops with a default block, executed in the event that the loop is
never entered.
https://wiki.php.net/rfc/loop_or
While this might be useful, I’d prefer we copy Python’s else behaviour, where a
On 20/09/2014 01:02, Rowan Collins wrote:
I certainly don't see (a) and (f) as being at all mutually exclusive.
Sorry, that was meant to say (a) and (e). Or, in plain English, I don't
see why we couldn't have both Smarty-style if the loop executed zero
times and Python-style if the break
22 matches
Mail list logo