At 12:21 19/08/2004, Sascha Schumann wrote:
On Thu, 19 Aug 2004, Rasmus Lerdorf wrote:
On Thu, 19 Aug 2004, Hartmut Holzgraefe wrote:
Alan Knowles wrote:
- compile time hooking (no dynamic goto targets)
That kind of makes them useless for writing parsers, which was one of
the justifications of
On Thu, 19 Aug 2004, Rasmus Lerdorf wrote:
On Thu, 19 Aug 2004, Hartmut Holzgraefe wrote:
Alan Knowles wrote:
- compile time hooking (no dynamic goto targets)
That kind of makes them useless for writing parsers, which was one of
the justifications of them.
How that? C doesn't have dynamic goto
Rasmus Lerdorf wrote:
Alan Knowles wrote:
How that? C doesn't have dynamic goto targets either
but still its used for parsing lot ...
That depends on what you consider C.
Try compiling this with your favourite C compiler:
Every day you lern something new ...
looks like i'm already done with that f
On Thu, 19 Aug 2004, Hartmut Holzgraefe wrote:
> Alan Knowles wrote:
> >
> >>- compile time hooking (no dynamic goto targets)
> >>
> >>
> > That kind of makes them useless for writing parsers, which was one of
> > the justifications of them.
>
> How that? C doesn't have dynamic goto targets ei
if you look at the bison/flex, they both use switch/case - the parsers I
use, both generate code like this, however they ended up using variable
functions, as even the overhead of the function calls is faster than the
large switch/case called repeatidly.. (this is ideally what dynamic
goto's c
At 04:28 19/08/2004, Hartmut Holzgraefe wrote:
Sebastian Bergmann wrote:
Exceptions are not an OOP feature per-se. They are a means for out-of-
band error signalling. (Of course they use objects for that which could
be regarded as a turn-off by non-OOP-eople :-)
they can also be a turn-off for p
Alan Knowles wrote:
- compile time hooking (no dynamic goto targets)
That kind of makes them useless for writing parsers, which was one of
the justifications of them.
How that? C doesn't have dynamic goto targets either
but still its used for parsing lot ...
--
Hartmut Holzgraefe <[EMAIL P
Is it good idea (and is it possible) to disallow GOTO in main() ?
Andrey
Quoting Robert Cummings <[EMAIL PROTECTED]>:
> On Wed, 2004-08-18 at 21:34, BDKR wrote:
> > Hartmut Holzgraefe wrote:
> >
> > > Sebastian Bergmann wrote:
> > >
> > >> Exceptions are not an OOP feature per-se. They are a m
On Thu, 2004-08-19 at 00:10, Alan Knowles wrote:
>
> >- compile time hooking (no dynamic goto targets)
> >
> >
> That kind of makes them useless for writing parsers, which was one of
> the justifications of them.
Hmmm you're right. I forgot that in C when doing parsers it's
commonplace to
- compile time hooking (no dynamic goto targets)
That kind of makes them useless for writing parsers, which was one of
the justifications of them.
Regards
Alan
- goto can only jump to labels within the same scope
- goto could only jump out of blocks and not into
Cheers,
Rob.
--
PH
Marcus Boerger wrote:
Not exactly. In most languages exceptions are objects but in other
languages like C++ you can pass whatever you want as amn exception.
I made the mistake of mixing the general case (out-of-band error
signalling) and the special case (Exception objects in PHP).
--
Sebastian B
On Wed, 2004-08-18 at 21:34, BDKR wrote:
> Hartmut Holzgraefe wrote:
>
> > Sebastian Bergmann wrote:
> >
> >> Exceptions are not an OOP feature per-se. They are a means for out-of-
> >> band error signalling. (Of course they use objects for that which could
> >> be regarded as a turn-off by non
Hartmut Holzgraefe wrote:
Sebastian Bergmann wrote:
Exceptions are not an OOP feature per-se. They are a means for out-of-
band error signalling. (Of course they use objects for that which could
be regarded as a turn-off by non-OOP-eople :-)
they can also be a turn-off for performance anxious p
Sebastian Bergmann wrote:
Exceptions are not an OOP feature per-se. They are a means for out-of-
band error signalling. (Of course they use objects for that which could
be regarded as a turn-off by non-OOP-eople :-)
they can also be a turn-off for performance anxious people
--
Hartmut Holzgraefe
Hello Sebastian,
Wednesday, August 18, 2004, 11:58:33 PM, you wrote:
> Derick Rethans wrote:
>> heh? If you're writing procedural code, you do not WANT to use OO
>> features in there, as it makes your code no longer procedural.
> Exceptions are not an OOP feature per-se. They are a means for o
Derick Rethans wrote:
heh? If you're writing procedural code, you do not WANT to use OO
features in there, as it makes your code no longer procedural.
Exceptions are not an OOP feature per-se. They are a means for out-of-
band error signalling. (Of course they use objects for that which could
be
If anyone in this debate hasn't read my independent request for goto and
"break label;", I would appreciate it if you would:
http://bugs.php.net/bug.php?id=29287
I fully support the implementation of goto. Line labels will also
immensely improve the break statement, which currently requires yo
thanks
it's my mistake, i didn't want to reply this thread but reply to my own one
From: Derick Rethans <[EMAIL PROTECTED]>
To: Marcus Boerger <[EMAIL PROTECTED]>
CC: tinys xuefer <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] GOTO operator
Date: Wed, 4 A
On Wed, 4 Aug 2004, Marcus Boerger wrote:
> Hello tinys,
>
> that's the perfect place to mail such things
But make sure to use a good subject... (and don't piggy back on other
threads with a new topic) please
Derick
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
Hello tinys,
that's the perfect place to mail such things
regards
marcus
Wednesday, August 4, 2004, 12:07:46 PM, you wrote:
> i'm current trying:
> MAKE_STD_ZVAL(return_value);
> *return_value = **zstr;
> /*ZVAL_ADDREF(*zstr);*/
> if (PZVAL_IS_REF(return_value))
ace to ask the question here?
it is said:
Internals list
A medium volume list for those who want to __help out__ with the development
of PHP
From: "tinys xuefer" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] GOTO operator
Date: Sat, 31 Jul 2004 15:16:54 +0800
MIME
Jochem: +1 :)
> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED]
> Sent: 04 August 2004 01:22
> To: Sara Golemon
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DEV] GOTO operator
>
>
> I'm +1 on goto with static labels.
>
> regardless
I'm +1 on goto with static labels.
regardless of whether it ends up in PHP or not I think Sara deserves a
gold star alone for the large number of very value info/explainations
she continues to post here. If I had to name one person off the list
from whose posts I had gained more insight & knowle
Hello,
ALthough I'm in support of a local scoped static GOTO, I did not see
myself using it much.
However, I find myself this afternoon implementing a huge
do { switch { case: break 2; } while (true) structure.
It would be much "cleaner" to use goto in this case.
--
Best regards,
J
On Aug 3, 2004, at 3:09 PM, [EMAIL PROTECTED] wrote:
"Sara Golemon" <[EMAIL PROTECTED]> writes:
If you really, really, really wanted to do such a thing, you could
still
do:
eval("goto foo$bar;");
to get the same effect, right?
Hmm, depends on how it's implemented. It will most likely not work I
> Out of curiosity, I wonder which other features would similarly not work
when
> eval()'ed...???
>
Anything involving unbalanced braces would bork:
eval('if ($a > 5) {');
do_stuff();
}
As would any looping initializer like this:
eval('foreach($foo as $bar)');
do_itteration($bar);
While I
"Sara Golemon" <[EMAIL PROTECTED]> writes:
>> > If you really, really, really wanted to do such a thing, you could still
> do:
>> >
>> > eval("goto foo$bar;");
>> >
>> > to get the same effect, right?
>>
>> Hmm, depends on how it's implemented. It will most likely not work I
>> guess.
>>
> Nope.
It can't be doable because it makes writing an optimizer impossible.
-sterling
On Tue, 3 Aug 2004 11:54:28 -0700, Sara Golemon <[EMAIL PROTECTED]> wrote:
> > > If you really, really, really wanted to do such a thing, you could still
> do:
> > >
> > > eval("goto foo$bar;");
> > >
> > > to get th
> > If you really, really, really wanted to do such a thing, you could still
do:
> >
> > eval("goto foo$bar;");
> >
> > to get the same effect, right?
>
> Hmm, depends on how it's implemented. It will most likely not work I
> guess.
>
Nope... eval()'d code is in a separate op_array from the code
On Tue, 3 Aug 2004 [EMAIL PROTECTED] wrote:
> Andi Gutmans <[EMAIL PROTECTED]> writes:
>
> > I don't think we should be using computed targets. It'd be more of a
> > nightmare than sexy. I prefer doing as much at compile-time as possible and
> > I don't think that allowing indirect goto's would le
Andi Gutmans <[EMAIL PROTECTED]> writes:
> I don't think we should be using computed targets. It'd be more of a
> nightmare than sexy. I prefer doing as much at compile-time as possible and
> I don't think that allowing indirect goto's would lead to anything than
> chaos. Most arguments in favor o
Quoting DvDmanDT <[EMAIL PROTECTED]>:
> > And my point still remains. There are an awful lot of PHP programmers out
> > there who really don't need an extra way to write for(), or while(), or
> > do..while(). It makes maintenance work harder when you have a mixture of
> > styles in there to cope
On Mon, 2004-08-02 at 23:08, Steph wrote:
> > My point was to say it's powerful, as powerful as all those, not that it
> > could replace them.. I would still use while(), do..while() and for() the
> > times they are intended for.. I'm sure most of the people would..
> > There are
> > however situat
> My point was to say it's powerful, as powerful as all those, not that it
> could replace them.. I would still use while(), do..while() and for() the
> times they are intended for.. I'm sure most of the people would..
> There are
> however situations where goto is what makes sense..
I'm still wai
> And my point still remains. There are an awful lot of PHP programmers out
> there who really don't need an extra way to write for(), or while(), or
> do..while(). It makes maintenance work harder when you have a mixture of
> styles in there to cope with.
>
> I don't for a moment believe that Sa
> My point still remains.. Goto is powerful, even if not needed.. There's
> about one time I would use goto, which could easily be done with two
> do..while().. The funny thing is, that I didn't do it that way, cause I
> though it looked ugly.
And my point still remains. There are an awful lot of
My point still remains.. Goto is powerful, even if not needed.. There's
about one time I would use goto, which could easily be done with two
do..while().. The funny thing is, that I didn't do it that way, cause I
though it looked ugly.
--
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia
> My opinion would be that goto isn't needed with the do..while()
> statement..
> But on the other hand.. Neither for(), while() or do..while() would be
> needed with goto, would they?
I learned a language called PHP. It contains for(), while() and
do..while(). I've been writing scripts that con
> I just woke up but I think this can be solved with one do..while and using
> bitfield for example. so when you break, just check the bitfield what to
> clean up.
Indeed, but the original point was to make it easier to read.. Now, what
will make most sense to a newbie, this or the goto example th
At 11:22 02/08/2004, Derick Rethans wrote:
On Sun, 1 Aug 2004, Zeev Suraski wrote:
> At 15:45 31/07/2004, Derick Rethans wrote:
> >Exceptions are an OO thing, and it makes NO sense to use them in
> >procedural code. Goto is a good thing here.
>
> Can you explain why it makes no sense to use them in
On Sun, 1 Aug 2004, Zeev Suraski wrote:
> At 15:45 31/07/2004, Derick Rethans wrote:
> >Exceptions are an OO thing, and it makes NO sense to use them in
> >procedural code. Goto is a good thing here.
>
> Can you explain why it makes no sense to use them in procedural code?
heh? If you're writing
if you have a look at a parser generated for PHP (eg. this - quite large
file)
http://cvs.php.net/co.php/pear/HTML_Template_Flexy/Flexy/Tokenizer.php?r=1.51
The original Java/C# stuff does switch/case, In PHP due to the fact you
have to evaluate each switch, it used to be quite slow,
I ended up
--- Sterling Hughes <[EMAIL PROTECTED]> wrote:
> also, when you start quoting djikstra in a php context, you've
> lost.
>
> goto is fine, fight the power!
s/quoting djikstra/mentioning state machines/
also
s/quoting djikstra/agonising about the algorithmic efficiency of
goto versus switch/
"Michael Walter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Another possibility, possibly more concise, would be to introduce a
> "scoped" keyword (or similar) in the spirit of "global":
>
>scoped $foo;
>
> might make $foo's destructor be called at the end of the current scop
At 15:45 31/07/2004, Derick Rethans wrote:
Exceptions are an OO thing, and it makes NO sense to use them in
procedural code. Goto is a good thing here.
Can you explain why it makes no sense to use them in procedural code? It
makes perfect sense for me, and they render 100.0% of the examples shown
200, Michael Walter wrote:
Paul G wrote:
- Original Message - From: "Michael Walter" <[EMAIL PROTECTED]>
To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
pre
ul G wrote:
- Original Message - From: "Michael Walter" <[EMAIL PROTECTED]>
To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
presumably, you see the need in C because it
"Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
presumably, you see the need in C because it's the cleanest way to
free()
all you've malloc()ed along the way, regardless of where you'
Paul G wrote:
- Original Message -
From: "Michael Walter" <[EMAIL PROTECTED]>
To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
presumably, you see the need
i'm just piping up that i'm a strong +1 on goto, its immensely useful
for code generators, like for example a gui application that wanted to
generate some type of php code.
also, when you start quoting djikstra in a php context, you've lost.
goto is fine, fight the power!
-sterling
On Sat, 3
> How does the GOTO implementation handle this
> script1.php
>
> do_some_stuff();
> include script2.php;
>
> label:
>echo "Hello"
> ?>
>
> script2.php:
> declare_some_funcs();
> some code ...
> if (some_cond) {
>goto label;
> }
> other code
> ?>
>
Inc
On Sat, 31 Jul 2004, Paul G wrote:
> actually, alloc/dealloc was just used as an example. it could be anything -
> rollback, closing sockets, pretty much any sort of 'undoing' that you need
> to do to make it look like nothing ever happened ;) what you are suggesting
> is similar to the hack i'm us
- Original Message -
From: "Michael Walter" <[EMAIL PROTECTED]>
To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
> > presumably, you see the nee
Sara Golemon wrote:
Thanks for the pointers, I at least see what I need to be exploring now
(though I havn't sat down to unfold its meaning yet). Cetainly the
implementation given earlier needs work whether its to make it work as
advertised or in the more limited fashion suggested in other posts.
Hiho,
Paul G wrote:
- Original Message -
From: "Andi Gutmans" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, July 30, 2004 2:08 PM
Subject: Re: [PHP-DEV] GOTO operator
--- snip ---
I'm sorry but I just don't underst
On Fri, 30 Jul 2004, Andi Gutmans wrote:
> At 10:31 PM 7/30/2004 +0200, Edin Kadribasic wrote:
> >Andi Gutmans wrote:
> >
> >[snip]
> >
> >I didn't say it cannot be done with goto emulation (and abuse of a feature
> >on par with switch(true)). What I mean is that using the real thing makes
> >code
On Thu, 29 Jul 2004, Sara Golemon wrote:
> *this* implementation of GOTO requires a hash lookup, however it could be
> reworked to use the same backpatching as the ZEND_JMP ops used with
> conditional statements. While doing that would speed execution time by
> skipping the hash lookup, it'd slow
On Fri, 30 Jul 2004, Jeff Moore wrote:
>
> On Jul 30, 2004, at 4:33 PM, Edin Kadribasic wrote:
>
> > Jeff Moore wrote:
> >
> >> Where did the if statements go? do_stuff(), do_more_stuff(), and
> >> do_even_more_stuff() should throw exceptions rather than return
> >> boolean error indicators.
> >
On Fri, 30 Jul 2004, Edin Kadribasic wrote:
> On Friday 30 July 2004 00:43, Paul G wrote:
> [snip]
>
> This is exactly the kind of code that makes me miss goto so much for error
> handling.
I agree with that, +1 on goto from me, but still... only constant labels
please!
Derick
--
PHP Internals
On Wed, 28 Jul 2004, Sara Golemon wrote:
> I wrote up a patch for implementing gotos in php scripts a couple months ago
> as an exercise in working with the Zend engine. I put it aside assuming
> noone would actually want it, but Wez and Ilia convinced me to post it for
> consideration:
>
> Descr
On Fri, 30 Jul 2004, Aidan Lister wrote:
> > Develop some wacky construct that you have to use instead... that way, it
> > will scare off novice users, and expert programmers will HAVE to know what
> > they're doing and know that they really need it before they have to
> > implement it. It's along
Hi Sara,
I can see where I can similfy certain code on a project I coded which
would reduce some major ugly code. Sure I could have rewritten the
code in c but I prefered having something easier to maintain in the
early hours of the morning.
Drop me a line where I can find the updated patches on
how about: "break label;" ?
just a thought
From: Andi Gutmans <[EMAIL PROTECTED]>
To: "Sara Golemon" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
Subject: Re: [PHP-DEV] GOTO operator
Date: Sat, 31 Jul 2004 00:13:51 -0700
MIME-Version: 1.0
X-Sender: [EMAIL PROTEC
At 09:24 PM 7/30/2004 -0700, Sara Golemon wrote:
> > > c) I don't think you are creating the necessary switch_free's and
other
> > > frees when jumping out of a scope unexpectedly.
> > >
> >Entirely possible. The tests I've run don't complain but that doesn't
mean
> >something bad isn't happening.
> > > c) I don't think you are creating the necessary switch_free's and
other
> > > frees when jumping out of a scope unexpectedly.
> > >
> >Entirely possible. The tests I've run don't complain but that doesn't
mean
> >something bad isn't happening.
>
Thanks for the pointers, I at least see what I
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jan Dittmer wrote:
> > Andrey Hristov wrote:
> >
> >> Robert Cummings wrote:
> >>
> >>>
> >>>
> >>> Unmaintainable because of the ability to write cryptic code. There's
> >>> nothing cryptic about:
> >>>
> >>> ...cod
Personally I would never use it myself, as I know of better ways around it
which make more sense to me. But on the other hand if it would help others
then more power to yah. I think the argument of user's abusing it is bogus,
as clearly mentioned in this thread. There isn't a WTF factor, as almo
Hello,
On Thu, Jul 29, 2004 at 11:43:13PM -0700, Andi Gutmans wrote:
> [...]
>
> Let's for a second skip discussion of the patch itself, because although it
> was an interesting exercise the patch is not production ready.
> However, I think before talking about implementation, we need to decide
Hello Andi,
That being said, I TOTALLY agree with your 2 rules. Thanks.
Also, by limiting it to local scope and not being able to jump into
an execution block would limit it's ability to make really nasty
spaghetti code -AND- in my understanding provide the desired
"professional" funct
At 09:19 PM 7/30/2004 -0400, Robert Cummings wrote:
On Fri, 2004-07-30 at 21:16, Jason Garber wrote:
> Hello Andi,
>
> Sorry for being unclear on this, but what is the exact definition of
> an "execution block" in this context?
Can't jump into an "if" block or "while" block etc. Only out.
Yep e
On Fri, 2004-07-30 at 21:16, Jason Garber wrote:
> Hello Andi,
>
> Sorry for being unclear on this, but what is the exact definition of
> an "execution block" in this context?
Can't jump into an "if" block or "while" block etc. Only out.
Cheers,
Rob.
--
.
Hello Andi,
Sorry for being unclear on this, but what is the exact definition of
an "execution block" in this context?
Thanks!
--
Best regards,
Jasonmailto:[EMAIL PROTECTED]
Friday, July 30, 2004, 9:08:09 PM, you wrote:
AG> Hi Jason,
AG> I think that in any
Hi Jason,
I think that in any case, if it is implemented it will have to follow two
basic rules:
a) The goto has to be local.
b) You can't jump into an execution block but only out of one.
Andi
At 09:06 PM 7/30/2004 -0400, Jason Garber wrote:
PG> [snip] i'm somewhat confuzzled why you, of all peo
PG> [snip] i'm somewhat confuzzled why you, of all people, are advocating such
PG> mutilation of do-while(), which is *abuse* of the construct. mutilating one
PG> construct to emulate another construct, which won't be implemented because
PG> it could be abused and mutilated, just doesn't compute fo
- Original Message -
From: "Andi Gutmans" <[EMAIL PROTECTED]>
To: "Edin Kadribasic" <[EMAIL PROTECTED]>; "Zeev Suraski" <[EMAIL PROTECTED]>
Cc: "Jeff Moore" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PR
On Fri, 2004-07-30 at 17:11, Shaun Thomas wrote:
> Hartmut Holzgraefe wrote:
>
> > The JAVA approach is even superior to PHPs "break n;"
> > where n has to be an integer and you have to be very
> > carefull to not wrap another loop around the break
> > but within the loop supposed to be broken
>
On Jul 30, 2004, at 4:33 PM, Edin Kadribasic wrote:
Jeff Moore wrote:
Where did the if statements go? do_stuff(), do_more_stuff(), and
do_even_more_stuff() should throw exceptions rather than return
boolean error indicators.
Now imagine do_stuff() and friends were native PHP functions ;)
You mi
Hartmut Holzgraefe wrote:
The JAVA approach is even superior to PHPs "break n;"
where n has to be an integer and you have to be very
carefull to not wrap another loop around the break
but within the loop supposed to be broken
Very true. Labeled breaks would be the "goto" that people seem to want
Jeff Moore wrote:
function pseudocode() {
try {
$a = allocate_resource_z();
$b = allocate_resource_y();
$res = do_stuff();
$c = allocate_resource_x();
$res = do_more_stuff();
$d = allocate_resource_foo();
$res = do_even_more_stuff();
David Kingma wrote:
Where did the if statements go? do_stuff(), do_more_stuff(), and
do_even_more_stuff() should throw exceptions rather than return
boolean error indicators.
Now imagine do_stuff() and friends were native PHP functions ;)
Good point, but should we fix this with a goto operator
>> Where did the if statements go? do_stuff(), do_more_stuff(), and
>> do_even_more_stuff() should throw exceptions rather than return
>> boolean error indicators.
>
>Now imagine do_stuff() and friends were native PHP functions ;)
Good point, but should we fix this with a goto operator or get
Andi Gutmans wrote:
so you are replacing the question "where does it go to"
that can be answered with a string search wiht "where
does it break to"
This one alone justifies at least labeled breaks as
JAVA has them and that are a kind of restricted GOTO
(as you can also break out of an if)
The JAVA
At 10:31 PM 7/30/2004 +0200, Edin Kadribasic wrote:
Andi Gutmans wrote:
[snip]
I didn't say it cannot be done with goto emulation (and abuse of a feature
on par with switch(true)). What I mean is that using the real thing makes
code more readable and maintinable. Add another level of nesting and
Jeff Moore wrote:
Where did the if statements go? do_stuff(), do_more_stuff(), and
do_even_more_stuff() should throw exceptions rather than return boolean
error indicators.
Now imagine do_stuff() and friends were native PHP functions ;)
Edin
--
PHP Internals - PHP Runtime Development Mailing Li
Andi Gutmans wrote:
[snip]
I didn't say it cannot be done with goto emulation (and abuse of a
feature on par with switch(true)). What I mean is that using the real
thing makes code more readable and maintinable. Add another level of
nesting and do/while becomes even harder to read.
Edin
--
PHP
On Jul 30, 2004, at 10:35 AM, Shaun Thomas wrote:
Paul G wrote:
function pseudocode()
{
$a=allocate_resource_z();
$b=allocate_resource_y();
$res=do_stuff();
if(!$res)
goto err_out;
$c=allocate_resource_x();
$res=do_more_stuff();
if(!$res)
goto err_out;
At 22:53 30/07/2004, Edin Kadribasic wrote:
[snip]
And can you explain why you can't solve this with exceptions in 2 minutes?
And please, stop the 'dictator!' accusations. If whatever came out of my
mouth was immediately implemented in PHP, we'd have libxml2 bundled and
SOAP support built-in (ju
At 09:53 PM 7/30/2004 +0200, Edin Kadribasic wrote:
function pseudocode()
{
$a=allocate_resource_z();
$b=allocate_resource_y();
do {
$res=do_stuff();
if(!$res)
break;
$c=allocate_resource_x();
$res=do_more_stuff();
if(!$res)
break;
$d=allocate_resourc
Zeev Suraski wrote:
At 22:26 30/07/2004, Edin Kadribasic wrote:
On Friday, Jul 30, 2004, at 21:16 Europe/Copenhagen, Zeev Suraski wrote:
My 2c - we shouldn't discuss the implementation in the same context
as whether we should have it, because it moves the focus away from
the source of the problem
Zeev,
First, thanks for the complement ;-).
I doubt most people became great programmers overnight. Most people have
learned with time, often from their own mistakes or mistakes they observed
others doing. Restricting a language can limit how badly you can screw up,
but it also limits what cou
On Fri, 2004-07-30 at 15:13, Andi Gutmans wrote:
> At 03:11 PM 7/30/2004 -0400, Robert Cummings wrote:
> >On Fri, 2004-07-30 at 13:11, Andi Gutmans wrote:
> > > Rob,
> > >
> > > First of all I don't know where you are getting O(n) from because the
> > > operation is O(1).
> > > Secondly, I just don
At 22:26 30/07/2004, Edin Kadribasic wrote:
On Friday, Jul 30, 2004, at 21:16 Europe/Copenhagen, Zeev Suraski wrote:
My 2c - we shouldn't discuss the implementation in the same context as
whether we should have it, because it moves the focus away from the
source of the problem, which is not imple
On Friday, Jul 30, 2004, at 21:16 Europe/Copenhagen, Zeev Suraski wrote:
My 2c - we shouldn't discuss the implementation in the same context as
whether we should have it, because it moves the focus away from the
source of the problem, which is not implementation. We're way beyond
the times when
At 12:13 PM 7/30/2004 -0700, Sara Golemon wrote:
> a) Performance wise the right thing to do is to use static labels and
> pre-compute them during compile-time (I remembered you were aware of
that).
> b) We therefore should not require an additional opcode for goto.
>
I did consider that, but the i
My 2c - we shouldn't discuss the implementation in the same context as
whether we should have it, because it moves the focus away from the source
of the problem, which is not implementation. We're way beyond the times
when we add something to PHP just because we can... I'm not saying we
shoul
+1
On Wed, 28 Jul 2004 22:55:53 -0400, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote:
> Goto is an extremely useful for parsers and makes life much easier when
> dealing with complex error handling situations.
>
> +1
>
> Ilia
>
>
>
> On July 28, 2004 10:12 pm, Sara Golemon wrote:
> > I wrote up
> a) Performance wise the right thing to do is to use static labels and
> pre-compute them during compile-time (I remembered you were aware of
that).
> b) We therefore should not require an additional opcode for goto.
>
I did consider that, but the idea of computed targets (goto "foo$bar";)
souded
At 03:11 PM 7/30/2004 -0400, Robert Cummings wrote:
On Fri, 2004-07-30 at 13:11, Andi Gutmans wrote:
> Rob,
>
> First of all I don't know where you are getting O(n) from because the
> operation is O(1).
> Secondly, I just don't understand what the sudden necessity for the goto
> construct is when o
On Fri, 2004-07-30 at 13:11, Andi Gutmans wrote:
> Rob,
>
> First of all I don't know where you are getting O(n) from because the
> operation is O(1).
> Secondly, I just don't understand what the sudden necessity for the goto
> construct is when over the years we have barely ever had a PHP devel
"Sara Golemon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > >The C# goto is limited: "goto statements can transfer control within
> > >blocks and out of blocks, but never into blocks." Does the PHP goto
> > >implementation have this limitation?
> > >
> > No it doesn't. As I men
1 - 100 of 200 matches
Mail list logo