1. RE: A Euphoria wish list item (minor)

> > for i = 1 to 10 do
> >   for j = 1 to 10 do
> >     -- do whatever
> >     if some_sequence[i][j] = whatever then
> 
> then goto nextstep
> 
> >        exit_flag = TRUE
> >        exit 
> >     end if
> >   end for
> >   if exit_flag = TRUE then
> >     exit 
> >   end if
> > end for
> 
> :nextstep:
>  
> > ...wheras a nice "exit(2)" inside the j loop would do nicely...
> 
> So does goto.

I'm assuming you would not allow jumps INTO looped code.

new topic     » topic index » view message » categorize

2. RE: A Euphoria wish list item (minor)

Kat wrote:
> 
> So does goto.
> 

Kat:
   Karl made the goto available for you in his interpeter.
   I don't see any edvidence of you using it.
   Maybe you shouldn't complain that it is it's not available.
Bernie

new topic     » goto parent     » topic index » view message » categorize

3. RE: A Euphoria wish list item (minor)

Kat wrote:
> On 15 Feb 2002, at 20:49, Andy Serpa wrote:
> 
> > 
> > While everyone is fighting about the future of the languange, I have a 
> > minor suggestion that I would find quite convienient:
> > 
> > Modify the "exit" statement so I can break out of nested loops, like the 
> > 
> > "break" statement in PHP.
> > 
> > So "exit" would become shorthand for "exit(1)", while "exit(2)" would 
> > break out of two loops, "exit(3)" would break out of 3, etc...
> 
> Ewwwwwww!
>  
> > Currently, I have to do something like this:
> > 
> > for i = 1 to 10 do
> >   for j = 1 to 10 do
> >     -- do whatever
> >     if some_sequence[i][j] = whatever then
> 
> then goto nextstep
> 
> >        exit_flag = TRUE
> >        exit 
> >     end if
> >   end for
> >   if exit_flag = TRUE then
> >     exit 
> >   end if
> > end for
> 
> :nextstep:
>  
> > ...wheras a nice "exit(2)" inside the j loop would do nicely...
> 
> So does goto.
> 

Actually, the only thing I'd ever use goto for is to bust out of nested 
loops.  Other than that, I don't like it...

new topic     » goto parent     » topic index » view message » categorize

4. RE: A Euphoria wish list item (minor)

On 15 Feb 2002, at 22:54, C. K. Lester wrote:

> 
> 
> > > for i = 1 to 10 do
> > >   for j = 1 to 10 do
> > >     -- do whatever
> > >     if some_sequence[i][j] = whatever then
> > 
> > then goto nextstep
> > 
> > >        exit_flag = TRUE
> > >        exit 
> > >     end if
> > >   end for
> > >   if exit_flag = TRUE then
> > >     exit 
> > >   end if
> > > end for
> > 
> > :nextstep:
> >  
> > > ...wheras a nice "exit(2)" inside the j loop would do nicely...
> > 
> > So does goto.
> 
> I'm assuming you would not allow jumps INTO looped code.

Correct. Personally, i wouldn't. However, it should also be possible for the 
jump into a loop to simply ignore the end loop line and fall thru it, and not
try
to loop. But this would be a questionable coding style.

Kat

new topic     » goto parent     » topic index » view message » categorize

5. RE: A Euphoria wish list item (minor)

Bernie wrote:

>Karl made the goto available for you in his interpeter.
>I don't see any evidence of you using it.

Kat, I'd suggest adding something like this in the "About" window of your 
next application:

   "Kat's New Chatterbot v1.0
    Now using 34 GOTO statements!"

so everyone can tell. Not everyone is as adept as Bernie is about knowing 
what statements you use in your code. blink

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

6. RE: A Euphoria wish list item (minor)

On 15 Feb 2002, at 23:41, Bernie Ryan wrote:

> 
> 
> Kat wrote:
> > 
> > So does goto.
> > 
> 
> Kat:
>    Karl made the goto available for you in his interpeter.
>    I don't see any edvidence of you using it.
>    Maybe you shouldn't complain that it is it's not available.

Excuse me, but the request was made for a change in Eu, which Robert 
says he won't make, so i pointed to the goto in Karl's interpreter. What 
evidence of the use of goto would you like to see? I won't have electricity or 
running water or heat tonight, but i can use the flashlight to write on paper 
and email it back tomorrow.

Kat

new topic     » goto parent     » topic index » view message » categorize

7. RE: A Euphoria wish list item (minor)

Java uses labeled breaks.  In java loops are labeled, a "continue" like 
statement for Euphoria would be nice too (also using labels).
So much for keeping Euphoria very simple.  :)

mistertrik at hotmail.com wrote:
> >Modify the "exit" statement so I can break out of nested loops, like 
> >>the 
> >"break" statement in PHP.
> >
> >So "exit" would become shorthand for "exit(1)", while "exit(2)" would
> >break out of two loops, "exit(3)" would break out of 3, etc...
> 
> <SARCASM>
>     Haven't seen this request before....
> </SARCASM>
> 
> 
> P.S. Hey Kat, there's some new tags for .htx
> 
> --Mr Trick
> 
> 



Regards,
Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu