Re: [PHP-DEV] The jump operator

2008-04-05 Thread Jeff Moore


On Apr 4, 2008, at 4:18 AM, Derick Rethans wrote:


http://youngbloods.org/essays/argument_for_goto.html has an IMO good
example. It's java code, but it shows how goto can help you get rid of
nesting hell.


Hi Derick,

The code in that example looks more like an argument for try ...  
finally to me than an argument for goto.  I have yet to see a good  
case for goto (not break) that doesn't involve parsing or error  
handling, and we have exceptions already for error handling flow  
control.  But, we don't have try ... finally (and java doesn't have  
goto).


Best Regards,

Jeff

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] The jump operator

2008-04-04 Thread Arvids Godjuks
Link: http://news.php.net/php.internals/36536
One question - are you crazy? I heared about break with goto capabilities -
that's understandable - you could break 2 or 3 level loops, but this one
shit.


Re: [PHP-DEV] The jump operator

2008-04-04 Thread Alexey Zakhlestin
On Fri, Apr 4, 2008 at 12:43 PM, Arvids Godjuks
[EMAIL PROTECTED] wrote:
 Link: http://news.php.net/php.internals/36536
  One question - are you crazy? I heared about break with goto capabilities -
  that's understandable - you could break 2 or 3 level loops, but this one
  shit.

Could you please keep polite language?
Details of this construct were known for quite a long time, and it was
available in PHP6 for ages

it is a limited goto, just as advertised. you can get out of blocks
with it, but you can't go into blocks

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Richard Quadling
On 04/04/2008, Jani Taskinen [EMAIL PROTECTED] wrote:
 You're about year too late..or even more. Please, don't just this
  discussion now.

Is there use case that can be used for the documentation?

-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Arvids Godjuks
Well, why even add such functionality if it's doubtful it will be used. It
just ads confusion and anger to users, who knows what it does and what harm
can be done. GOTO functionality wasn't present in PHP and i think should
never be ever. break is fine..

2008/4/4, Alexey Zakhlestin [EMAIL PROTECTED]:

 On Fri, Apr 4, 2008 at 1:17 PM, Arvids Godjuks [EMAIL PROTECTED]
 wrote:
  just emotions, sorry.
 
  But why you didn't keep the break [1,2,3]; ? That was fine and
  understandable and it was limited to loops, but with this will make code
  messy, especially with if statements. I personally woun't use it at all,
 but
  it will be hell to get into badly coded projects with jump's in it.
 And it
  was easily done with try/catch.


 break [1,2,3] is still there

 the following was removed

 $i = 2;
 break $i;

 while I, personnaly, agree, that for error-handling situations
 try/catch is a superior solution, the new goto construct can be
 useful for micro-optimizations
 I doubt, I will be using it, though :-)

 p.s. you replied me offlist. you should cc it, if you want to keep
 discussion running


  2008/4/4, Alexey Zakhlestin [EMAIL PROTECTED]:
 
   On Fri, Apr 4, 2008 at 12:43 PM, Arvids Godjuks
   [EMAIL PROTECTED] wrote:
Link: http://news.php.net/php.internals/36536
 One question - are you crazy? I heared about break with goto
  capabilities -
 that's understandable - you could break 2 or 3 level loops, but
 this
  one
 shit.
  
  
   Could you please keep polite language?
   Details of this construct were known for quite a long time, and it was
   available in PHP6 for ages
  
   it is a limited goto, just as advertised. you can get out of blocks
   with it, but you can't go into blocks
  
  
   --
   Alexey Zakhlestin
   http://blog.milkfarmsoft.com/
  
 
 
 --

 Alexey Zakhlestin
 http://blog.milkfarmsoft.com/



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Daniel T. Gorski
On 04 Apr 13:07, Alexey Zakhlestin wrote:

Hi,

 Link: http://news.php.net/php.internals/36536

 it is a limited goto, just as advertised. you can get out of blocks
 with it, but you can't go into blocks

Shouldn't it be e.g. 'leave' instead of 'goto' then? Just to avoid confusion.

regards dtg

-- 
_
ASCII ribbon campaign  ( )
 against HTML e-mailX
   / \

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Jani Taskinen
You're about year too late..or even more. Please, don't just this
discussion now.

--Jani

On Fri, 2008-04-04 at 13:35 +0300, Arvids Godjuks wrote:
 Well, why even add such functionality if it's doubtful it will be used. It
 just ads confusion and anger to users, who knows what it does and what harm
 can be done. GOTO functionality wasn't present in PHP and i think should
 never be ever. break is fine..
 
 2008/4/4, Alexey Zakhlestin [EMAIL PROTECTED]:
 
  On Fri, Apr 4, 2008 at 1:17 PM, Arvids Godjuks [EMAIL PROTECTED]
  wrote:
   just emotions, sorry.
  
   But why you didn't keep the break [1,2,3]; ? That was fine and
   understandable and it was limited to loops, but with this will make code
   messy, especially with if statements. I personally woun't use it at all,
  but
   it will be hell to get into badly coded projects with jump's in it.
  And it
   was easily done with try/catch.
 
 
  break [1,2,3] is still there
 
  the following was removed
 
  $i = 2;
  break $i;
 
  while I, personnaly, agree, that for error-handling situations
  try/catch is a superior solution, the new goto construct can be
  useful for micro-optimizations
  I doubt, I will be using it, though :-)
 
  p.s. you replied me offlist. you should cc it, if you want to keep
  discussion running
 
 
   2008/4/4, Alexey Zakhlestin [EMAIL PROTECTED]:
  
On Fri, Apr 4, 2008 at 12:43 PM, Arvids Godjuks
[EMAIL PROTECTED] wrote:
 Link: http://news.php.net/php.internals/36536
  One question - are you crazy? I heared about break with goto
   capabilities -
  that's understandable - you could break 2 or 3 level loops, but
  this
   one
  shit.
   
   
Could you please keep polite language?
Details of this construct were known for quite a long time, and it was
available in PHP6 for ages
   
it is a limited goto, just as advertised. you can get out of blocks
with it, but you can't go into blocks
   
   
--
Alexey Zakhlestin
http://blog.milkfarmsoft.com/
   
  
  
  --
 
  Alexey Zakhlestin
  http://blog.milkfarmsoft.com/
 
-- 
Patches/Donations: http://pecl.php.net/~jani/



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Derick Rethans
On Fri, 4 Apr 2008, Richard Quadling wrote:

 On 04/04/2008, Jani Taskinen [EMAIL PROTECTED] wrote:
  You're about year too late..or even more. Please, don't just this
   discussion now.
 
 Is there use case that can be used for the documentation?

http://youngbloods.org/essays/argument_for_goto.html has an IMO good 
example. It's java code, but it shows how goto can help you get rid of 
nesting hell.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] The jump operator

2008-04-04 Thread Edward Z. Yang
Richard Quadling wrote:
 Is there use case that can be used for the documentation?

Two big ones I can think of: Multi-loop breaks and parsers.

-- 
 Edward Z. YangGnuPG: 0x869C48DA
 HTML Purifier http://htmlpurifier.org Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php