Thread: goto
View Single Post
  #22  
Old 02-03-2008, 03:53 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Basically all the arguments FOR goto can be done with functions, and the rest of them don't really apply to Graal.

Gotos are largely used in languages with no functions or logical structure.

EDIT:
Yes, C++ has it, but if it was added into Graal it would just be a mess. I'm not saying it would be bad for every object oriented programming language, sorry if it came out that way, but it would mean searching through code to find that label, or however you do it, and then executing from there. The if the function ends, the code stops, because he was saying that he wants it to break from loops. Here is an example:

PHP Code:
function onCreated()
{
  for ( 
temp.foo )
  {
    if ( 
temp.== "bar" )
    {
      goto 
crap;
    }
  }
  
player.chat "gah"// won't happen
}
function 
myHouse()
{
  
label crap// however this is done
  
player.chat "yey im out";
// osht, the code is done running. 
__________________
Reply With Quote