Excellent work Dmitry. Hope your version of the patch gets accepted.
Well just go ahead and commit it :)
Edin
Dmitry Stogov wrote:
> Yes, we discussed.
> But I wasn't agree with "goto" at all.
> Now after looking in the patch, I see that limited "goto" can work.
>
> I still don't like "goto", but reusing name "break" for "goto" is mach
> worst.
>
> The following code works fine with Sara's patch:
>
> <?php
> while (1) {
> break L; /* why is it named "break"? This is "goto"! */
> }
> if ($a) {
> try {
> L:
> } catch (Exception $e) {
> }
> }
> ?>
>
> BTW: some languages has "break label" operatopr but it means exit from loop
> marked with specified label (this makes sense).
>
> L: while (1) {
> while (1) {
> break L; /* the same as "break 2" */
> }
> }
>
> Thanks. Dmitry.
>
>
>>-----Original Message-----
>>From: Derick Rethans [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, November 24, 2005 1:04 PM
>>To: Dmitry Stogov
>>Cc: 'Sara Golemon'; PHP Developers Mailing List; Andi
>>Gutmans; Zeev Suraski; Stanislav Malyshev; Marcus Boerger;
>>Wez Furlong; Andrei Zmievski; Jani Taskinen; Rasmus Lerdorf
>>Subject: RE: [PHP-DEV] Re: Labeled Breaks (not the G-word)
>>
>>
>>On Thu, 24 Nov 2005, Dmitry Stogov wrote:
>>
>>
>>>1) The new syntax makes mess for me.
>>>"break" is a statement that exits from loop or switch, now
>>
>>we make a
>>
>>>"goto" statement but name it "break". I belive that if we really
>>>implement goto (even with some limitations) we shuld name
>>
>>it "goto",
>>
>>>but not "break". (changed in attached patch).
>>>
>>>2) After (1) I don't see any reason in limitation to jump
>>
>>only down,
>>
>>>if we can jump up as well. (the limitation is removed in attached
>>>patch).
>>
>>We discussed both those points in the meeting, and afaik
>>agreed on the
>>current behavior for several reasons:
>>- "goto" has a bad feeling:
>>
>> "The name "goto" is misleading, and often associated with BAD
>> THINGS(tm). Because our proposed solution is not a real GOTO
>> construct, we will instead reuse the "break" keyword, and extend
>> it with a static label."
>>
>>- we wanted to prevent spagetti code which you can do by jumping up:
>>
>> "Similarly restricting the construct so that you can only jump
>> down should satisfy people who do not want the ability
>>to jump all over
>> the place."
>>
>>regards,
>>Derick
>>
>>
>
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php