Re: [RFC] Loop... or...

From: Date: Sat, 20 Sep 2014 16:44:53 +0000
Subject: Re: [RFC] Loop... or...
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-77388@lists.php.net to get a copy of this message
On 20 September 2014 15:43:46 GMT+01:00, Leigh <leight@gmail.com> wrote: >On 20 September 2014 01:02, Rowan Collins <rowan.collins@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 in order to avoid specifying every permutation in the grammar >it would require converting loop structures that currently have a >defined number of children, into list structures ("if" behaves like >this, with multiple optional "elseifs" and an optional "else"). Yeah, I absolutely didn't mean that all of these were equally essential, I was just brainstorming some of the possible permutations. I guess the only way to avoid running out of keywords would be to have a generic clause like "on(x)", but that's probably just asking for trouble... foreach ( $x as $y ) { ... } on ( break ) { ... } on ( nobreak ) { ... } on ( continue ) { ... } on ( nocontinue ) { ... } on ( noloop ) { ... } on ( loopcount == 1 ) { ... } Yeah, let's not do that! :p -- Rowan Collins [IMSoP]

« previous php.internals (#77388) next »