Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] GOTO replacement statements [RSS Feed]

#1 Nov. 30, 2005 17:24:08

Tim G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] GOTO replacement statements


I was wondering if it would be worthwhile to consider
replacing the functionality of a 'goto' statement with
two or maybe three statements.

'break_to' 'advance_to' and maybe even 'change_state_to'

while($foo1) as LABEL1 {
....
while($foo2) {
...
if($var1)
break;
if($var2)
break_to LABEL1;
...
if($var3)
advance_to LABEL2;
...
..
}

LABEL2:

'break_to' might make it easier for someone who
has to review/maintain the code to spot it as
a 'goto' replacement to break out of a nested loop.

'advance_to' would hopefully cut down on the number
of bug reports claiming that 'jump' doesn't work
properly (when trying to go backwards)



Regards,

Tim Gales

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

Offline

#2 Nov. 30, 2005 17:27:48

Stanislav M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] GOTO replacement statements


TG>>replacing the functionality of a 'goto' statement with
TG>>two or maybe three statements.
TG>>
TG>>'break_to' 'advance_to' and maybe even 'change_state_to'

And maybe even to
please_change_current_executing_opcode_number_to_the_opcode_that_corresponds_to_label

after all, we don't want to have any place for misunderstaning and we
definitely don't want to be rude... If we want to limit it to
forward-jump, we might add also
_but_only_if_it_does_not_mean_jumping_backwards. Then nobody would say it
is not intuitive, at least.

--
Stanislav Malyshev, Zend Products Engineer
http://www.zend.com/+972-3-6139665 ext.115

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] GOTO replacement statements [RSS Feed]

Board footer

Moderator control

Enjoy the 23rd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support