On Mon, 28 Nov 2005, Zeev Suraski wrote:
> I'm indifferent to adding the restricted goto, and against adding a
> full-featured goto. We can do well without either of them.
We discussed this in the meeting, and we wanted a limited goto in the
form of a break . Now the only addition here is the a
Ron Korving wrote:
Well that's because labeled breaks should (in "our" opinion) be implemented
paralel to goto. It is simply not the same. Of course you could break out of
loops with a goto statement, but I'd much prefer true labeled breaks, where
the label is set for the loop-construct itself,
Well that's because labeled breaks should (in "our" opinion) be implemented
paralel to goto. It is simply not the same. Of course you could break out of
loops with a goto statement, but I'd much prefer true labeled breaks, where
the label is set for the loop-construct itself, not after the const
Joao Cruz Morais wrote:
I'm sorry if I'm saying something that was already proposed, but why
not use the Java approach to labeled breaks or something like this
(dumb) example:
while(true) as outer_cycle {
$i = 0;
while(true)
if($i++ == 10) break outer_cycle;
}
well, this is only handli
I'm sorry if I'm saying something that was already proposed, but why
not use the Java approach to labeled breaks or something like this
(dumb) example:
while(true) as outer_cycle {
$i = 0;
while(true)
if($i++ == 10) break outer_cycle;
}
Regards,
João C Morais
On 11/29/05, Sara Golemon <
My objection to goto is based on the fact that it allows to randomly
transfer control between arbitary points of script, which can (and
will) easily lead to spaghetti code and actually promotes this style of
writing code.
Yes, I agree... Exceptions cause exactly that kind of confus...oh..wait...
SG>>random than a catch statement. It's a deliberate, directed statement, and
SG>>one which *does* clean up after itself despite your unfounded claims to the
SG>>contrary.
My objection to goto is based on the fact that it allows to randomly
transfer control between arbitary points of script, whi
It is clear from technical point. It is not clear from structural view,
since it can be any random place in code, not connected to the previos
place in any logical way.
Are you deliberately trying to be antagonistic? A goto label is no more
random than a catch statement. It's a deliberate, dir
hi Stanislav,
Stanislav Malyshev wrote:
LS>>How is that different from "goto"?
I start to suspect you just skip what I am writing. Didn't I explain that
exception does not allow to jump to random points and goto does?
LS>>And if you can jump through 80% if your code via an exception while y
Stanislav Malyshev wrote:
EK>>This might be from implementation/engine point of view, but from user's
EK>>perspective goto is much more limited. It can only happen within one
EK>>function.
That's good. PHP is a limited language - you can not do many things in PHP
that you can do in C, for examp
Stanislav Malyshev wrote:
> Exceptions are structured way of handling code flow - you can not get to
> random points of code with exception, you can get either to enclosing
> catch or stop the program entirely. Unlike exceptions, goto allows to
> jump to a random point of code. I don't know what
Stanislav Malyshev wrote:
HH>>a small objection here: with a GOTO it is clear where execution continues,
HH>>you can simply search for the label the GOTO is using. With exceptions on
It is clear from technical point. It is not clear from structural view,
since it can be any random place in code
HH>>a small objection here: with a GOTO it is clear where execution continues,
HH>>you can simply search for the label the GOTO is using. With exceptions on
It is clear from technical point. It is not clear from structural view,
since it can be any random place in code, not connected to the previ
Stanislav Malyshev wrote:
LS>>How is that different from "goto"?
I start to suspect you just skip what I am writing. Didn't I explain that
exception does not allow to jump to random points and goto does?
You are argue on technical/internals terms. I agrue that what is
"defined" and "clear"
It may be so that you can use exceptions as a sort of goto mechanism.
And from some perspective you may even find some similarities. However,
exceptions weren't invented for this purpose. (And they aren't
introduced into PHP for this reason.)
The main difference is that exceptions work with
Stanislav Malyshev wrote:
Precentage of code that lies between throw point and catch point has
nothing to do with anything. The structure of the code - that you
always know which block encloses the code with exception potential and which code
would handle the exception if it arises - has everyt
Exactly, I don't see why people are mixing up the two in this discussion. I
think everybody can agree that a labeled break would really add something to
PHP. goto is a totally different story that should be discussed parallel to
labeled break. It is _not_ the same thing and the two can co-exist
Stanislav Malyshev wrote:
> LS>>discussions over the past months it seemed to me that the "goto all the
> way"
> LS>>camp was fine with limiting jumping to the current scope (function/method)
>
> That doesn't do much. That's like saying "access not to all memory but
> only memory space of the pr
Stanislav Malyshev wrote:
Exceptions are structured way of handling code flow - you can not get to
random points of code with exception, you can get either to enclosing
catch or stop the program entirely. Unlike exceptions, goto allows to
jump to a random point of code.
a small objection her
LS>>How is that different from "goto"?
I start to suspect you just skip what I am writing. Didn't I explain that
exception does not allow to jump to random points and goto does?
LS>>And if you can jump through 80% if your code via an exception while you
LS>>unwind the stack it might be ordered
EK>>This might be from implementation/engine point of view, but from user's
EK>>perspective goto is much more limited. It can only happen within one
EK>>function.
That's good. PHP is a limited language - you can not do many things in PHP
that you can do in C, for example. Many of these things usu
Stanislav Malyshev wrote:
No, they are not. If you don't purposedly abuse it, exceptions are a
structured way to handle exceptional situations, with well-defined effects
and known control points. They won't allow you to randomly jump around the
code.
How is that different from "goto"?
And i
LS>>discussions over the past months it seemed to me that the "goto all the way"
LS>>camp was fine with limiting jumping to the current scope (function/method)
That doesn't do much. That's like saying "access not to all memory but
only memory space of the process". Sure, you can't just jump rando
Stanislav Malyshev wrote:
LS>>a scope limited goto will never be close as dangerous for spagetti
LS>>code as exceptions already are because they are not scope limited.
Exceptions are structured way of handling code flow - you can not get to
random points of code with exception, you can get eit
I agree.
Although there's aanother thread running about namespaces that are about
to do something with ':' as well. Watch out that there aren't conflicts?
Ron Korving wrote:
I agree. Like you I couldn't really care about a 'goto', I'd probably never
use it. But labeled breaks would really ad
I agree. Like you I couldn't really care about a 'goto', I'd probably never
use it. But labeled breaks would really add something to the language. The
current break counters aren't very user friendly if you ask me.
I'm very much in favor of:
LABEL: while (cond)
{
...
break LABEL;
...
}
I
On 29 November 2005 09:18, Bart de Boer wrote:
> I feel we're comparing apples with oranges here.
>
> Break; is for breaking out of loops. It shouldn't have anything to do
> with jumping to somewhere else. Let's say *if* PHP supported jumping
> through the code. The following should then be two d
I feel we're comparing apples with oranges here.
Break; is for breaking out of loops. It shouldn't have anything to do
with jumping to somewhere else. Let's say *if* PHP supported jumping
through the code. The following should then be two different things:
while (loop) {
goto LABEL;
}
:LAB
LS>>a scope limited goto will never be close as dangerous for spagetti
LS>>code as exceptions already are because they are not scope limited.
Exceptions are structured way of handling code flow - you can not get to
random points of code with exception, you can get either to enclosing
catch or s
Stanislav Malyshev wrote:
MB>>cool argument: as long as there are worse features we can add anything?
:-))
No, as long as the feature has high abuse potential (hint: goto does) it
is better not to add it. Of course, it's not always possible, some
features are vital even if dangerous. But got
goto++
On Sun, 2005-11-27 at 19:27 -0500, George Schlossnagle wrote:
> me 3.
>
> goto is good.
>
> Wez Furlong wrote:
>
> >me also
> >
> >
> >On 11/27/05, Edin Kadribasic <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Ilia Alshanetsky wrote:
> >>
> >>
> >>
> >>>If it comes down to count of +1/-
Hello Stanislav,
Monday, November 28, 2005, 8:37:37 PM, you wrote:
MB>>>cool argument: as long as there are worse features we can add anything?
:-))
> No, as long as the feature has high abuse potential (hint: goto does) it
> is better not to add it. Of course, it's not always possible, some
MB>>We are on the other end we don't have to decide if we can get the devil out
MB>>of php but simply decide not to let the devil in. If you really need goto
I agree with that.
--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115
--
PHP In
Hello Stanislav,
and don't forget that in languages like C you cannot take out the goto
because you would need to develop tons of compiler tools from scratch.
We are on the other end we don't have to decide if we can get the devil out
of php but simply decide not to let the devil in. If you real
MB>>cool argument: as long as there are worse features we can add anything?
:-))
No, as long as the feature has high abuse potential (hint: goto does) it
is better not to add it. Of course, it's not always possible, some
features are vital even if dangerous. But goto is nowhere near vital,
IM
Hello Stanislav,
cool argument: as long as there are worse features we can add anything? :-))
best regards
marcus
Monday, November 28, 2005, 10:38:35 AM, you wrote:
> IPC>>It seems illogical to put a limit on jumping backwards just because
> IPC>>someone mihgt make messy code. People are per
Hello Zeev,
I would like to point out that PHP has been changing over the last
few years from a language that Rasmus used for his online resume to
an enterprise grade application development language. I've
personally watched it go from PHP3 -> PHP4 -> PHP5, and *much*
anticipate the fut
Zeev Suraski wrote:
I'm indifferent to adding the restricted goto, and against adding a
full-featured goto. We can do well without either of them.
As I keep being told - "If you don't like something you don't have to
use it" ;) But while a controlled goto could be a useful tool for some
are
IPC>>It seems illogical to put a limit on jumping backwards just because
IPC>>someone mihgt make messy code. People are perfectly capable of
IPC>>making messy code regardless of what steps you might make to try to
IPC>>prevent it.
This is not correct. Example: if we had pointers (meaning, real
NBN>>gives the opportunity to screw their code to programmers, are you also
NBN>>affirming that C programmers are smarter than PHP programmers ? Goto has
had
Code of C programmers oftenly harder to understand, especially when
features like goto are used, especially if the programmer does not tak
I'm indifferent to adding the restricted goto, and against adding a
full-featured goto. We can do well without either of them.
Zeev
At 02:27 28/11/2005, George Schlossnagle wrote:
me 3.
goto is good.
Wez Furlong wrote:
me also
On 11/27/05, Edin Kadribasic <[EMAIL PROTECTED]> wrote:
I
7:07 PM
> To: Zeev Suraski
> Cc: Marcus Boerger; Wez Furlong; Edin Kadribasic; Derick
> Rethans; Dmitry Stogov; Sara Golemon; PHP Developers Mailing
> List; Andi Gutmans; Stanislav Malyshev; Andrei Zmievski; Jani
> Taskinen; Rasmus Lerdorf
> Subject: Re: [PHP-DEV] Re: Labeled
me 3.
goto is good.
Wez Furlong wrote:
me also
On 11/27/05, Edin Kadribasic <[EMAIL PROTECTED]> wrote:
Ilia Alshanetsky wrote:
If it comes down to count of +1/-1 about this feature, I am +1 for
unrestricted forward/backward jumps and -1 for restricted version.
I agree wi
me also.
On 11/27/05, Edin Kadribasic <[EMAIL PROTECTED]> wrote:
> Ilia Alshanetsky wrote:
>
> > If it comes down to count of +1/-1 about this feature, I am +1 for
> > unrestricted forward/backward jumps and -1 for restricted version.
>
> I agree with this.
>
> Edin
>
--
PHP Internals - PHP Runti
I totally agree with you Zeev, your concerns are justified and I appreciate
very much your concerns; they confirm PHP is not going to become yet another
language with tons of useless features. Nevertheless, my opinion is that
goto is not a complex language feature. It occurred to me quite a few tim
On Sunday 27 November 2005 21:55, Edin Kadribasic wrote:
> I agree with this.
+1 from me too for waht it's worth.
It seems illogical to put a limit on jumping backwards just because someone
mihgt make messy code. People are perfectly capable of making messy code
regardless of what steps you mi
On Sun, 27 Nov 2005 22:55:08 +0100
[EMAIL PROTECTED] (Edin Kadribasic) wrote:
> Ilia Alshanetsky wrote:
>
> > If it comes down to count of +1/-1 about this feature, I am +1 for
> > unrestricted forward/backward jumps and -1 for restricted version.
>
> I agree with this.
Same here
--Pierre
--
Ilia Alshanetsky wrote:
If it comes down to count of +1/-1 about this feature, I am +1 for
unrestricted forward/backward jumps and -1 for restricted version.
I agree with this.
Edin
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Sun, 2005-11-27 at 15:54, Zeev Suraski wrote:
>
> We *can* screw it if we go in the wrong
> direction, and adding redundant features which
> are useful in rare cases and much more likely to
> be abused than to be properly used is a good step
> in that direction. A lot of people are saying w
At 22:18 27/11/2005, Nicolas Bérard Nault wrote:
Goto exists in C. If you affirm that goto should
not exist in PHP because it gives the
opportunity to screw their code to programmers,
are you also affirming that C programmers are smarter than PHP programmers ?
I wouldn't make any statement re
Goto exists in C. If you affirm that goto should not exist in PHP because it
gives the opportunity to screw their code to programmers, are you also
affirming that C programmers are smarter than PHP programmers ? Goto has had
a bad reputation for far too much time.
+1 for goto.
On 11/27/05, Zeev S
Ilia Alshanetsky wrote:
If it comes down to count of +1/-1 about this feature, I am +1 for
unrestricted forward/backward jumps and -1 for restricted version.
same here
--
Hartmut Holzgraefe, Senior Support Engineer.
MySQL AB, www.mysql.com
--
PHP Internals - PHP Ru
Zeev Suraski wrote:
> Given that, I don't see the fact that this limitation is artificially
> imposed, implementation-wise, to have any significance at all, either
> way. The discussion should be on whether we should allow this
> functionality or not.
All I am trying to say is that there are not
At 20:03 27/11/2005, Robert Cummings wrote:
On Sun, 2005-11-27 at 07:54, Zeev Suraski wrote:
> Guys,
>
> Laughter has nothing to do with it.
>
> However, as discussed between those who attended the meeting in
> Paris, goto earned its bad connotations for a reason.
Goto got it's bad name from whe
Hello Ilia,
as far as i know "do while" works pretty well. Just to be sure try this:
php -r 'do { echo "Hello\n"; } while (0); echo "World\n";'
Sunday, November 27, 2005, 5:06:39 PM, you wrote:
> Zeev Suraski wrote:
>> 1. A forward-jumping construct only, to avoid giving users too much
>> am
On Sun, 2005-11-27 at 07:54, Zeev Suraski wrote:
> Guys,
>
> Laughter has nothing to do with it.
>
> However, as discussed between those who attended the meeting in
> Paris, goto earned its bad connotations for a reason.
Goto got it's bad name from when it was used to jump to line numbers. I
ca
Agreed; I use this style of coding a lot.
I'd prefer "goto" but can deal with it being called "jump".
--Wez.
On 11/27/05, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote:
> Zeev Suraski wrote:
> > 1. A forward-jumping construct only, to avoid giving users too much
> > ammo to shoot themselves in the
> Guys,
>
> Laughter has nothing to do with it.
>
> However, as discussed between those who attended the meeting
> in Paris, goto earned its bad connotations for a reason. It
> was agreed that providing a general-purpose C-goto equivalent
> is not a good idea because it *will* very quickly le
At 18:06 27/11/2005, Ilia Alshanetsky wrote:
Zeev Suraski wrote:
> 1. A forward-jumping construct only, to avoid giving users too much
> ammo to shoot themselves in the foot with spaghetti coding.
One of the major uses of "jump" is the ability to "retry on error" by
jumping backwards inside the
Zeev Suraski wrote:
> 1. A forward-jumping construct only, to avoid giving users too much
> ammo to shoot themselves in the foot with spaghetti coding.
One of the major uses of "jump" is the ability to "retry on error" by
jumping backwards inside the code. Given that the limit of the
functionalit
Hi,
On Sun, 27 Nov 2005, Zeev Suraski wrote:
I'm not sold on reusing the break construct for that, since we're not
really breaking, and I kind of like Ilia's "jump" idea. Another
possibility would be reusing 'continue', which makes a bit more English
sense, even though it's not very similar
On Sun, 27 Nov 2005, Zeev Suraski wrote:
I'm not sold on reusing the break construct for that, since we're not really
breaking, and I kind of like Ilia's "jump" idea. Another possibility would be
reusing 'continue', which makes a bit more English sense, even though it's not
very similar to co
Guys,
Laughter has nothing to do with it.
However, as discussed between those who attended the meeting in
Paris, goto earned its bad connotations for a reason. It was agreed
that providing a general-purpose C-goto equivalent is not a good idea
because it *will* very quickly lead to spaghetti
Hello Wez,
i already see the whole world laughing at us :-)
marcus
Thursday, November 24, 2005, 5:43:48 PM, you wrote:
> Agreed; I see no reason to call it break (that makes it even more
> confusing), and limiting jumps to one direction only is dumb; there is
> no technical reason to do that.
Christian Schneider wrote:
Sara Golemon wrote:
TBH, I was surprised to see this on the table in the first place
myself...
To me the summary of events looks like:
1) People disagree whether goto is A Good Thing
2) PDM discusses it and settles for a compromise solution
No, we settled on an ini
Wez Furlong wrote:
Agreed; I see no reason to call it break (that makes it even more
confusing), and limiting jumps to one direction only is dumb; there is
no technical reason to do that.
Perl has a "goto" keyword, but it's pronounced "magic goto". We can
have a "goto" keyword and pronounce it
Christian Schneider wrote:
> 3) internals removes the restrictions of the compromise
Only one restriction is being removed, it being the ability to jump back
in the code.
> ?) It is added even though no clear majority wanted a full-blown goto
Last time goto was discussed it was a very close dec
Sara Golemon wrote:
TBH, I was surprised to see this on the table in the first place myself...
To me the summary of events looks like:
1) People disagree whether goto is A Good Thing
2) PDM discusses it and settles for a compromise solution
3) internals removes the restrictions of the compromis
So, I'm +1 on the patch with sane names and removed restrictions;
Agreed.
- Sascha
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Wez Furlong wrote:
> Perl has a "goto" keyword, but it's pronounced "magic goto". We can
> have a "goto" keyword and pronounce it "limited goto".
If goto has bad connotations for many people and break seems confusing,
how about calling it "jmp" or "jump" which precisely what the code does.
Ilia
1) The new syntax makes mess for me.
2) After (1) I don't see any reason in limitation to jump only down,
Both of these items were based on the PDM meeting notes which required this
specific behavior.
2) Your patch doesn't care about freeing loop variables
and we got a memory leaks in the fol
Agreed; I see no reason to call it break (that makes it even more
confusing), and limiting jumps to one direction only is dumb; there is
no technical reason to do that.
Perl has a "goto" keyword, but it's pronounced "magic goto". We can
have a "goto" keyword and pronounce it "limited goto".
Bad
e (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:
Ilia Alshanetsky wrote:
> Derick Rethans wrote:
>
>
>>- 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.
Derick Rethans wrote:
> - 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."
IMO making this limitation p
t; 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 Taski
> Cc: Andi Gutmans; Zeev Suraski; Stanislav Malyshev; Marcus
> Boerger; Wez Furlong; Derick Rethans; Andrei Zmievski; Jani
> Taskinen; Rasmus Lerdorf
> Subject: RE: [PHP-DEV] Re: Labeled Breaks (not the G-word)
>
>
> Hi Sara,
>
> I didn't like "goto" in
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 no
Hi Sara,
I didn't like "goto" in PHP, but after looking in this patch I see that
limited "goto" can work.
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
79 matches
Mail list logo