1. A Euphoria wish list item (minor)
- Posted by Andy Serpa <renegade at earthling.net> Feb 15, 2002
- 486 views
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... 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 exit_flag = TRUE exit end if end for if exit_flag = TRUE then exit end if end for ...wheras a nice "exit(2)" inside the j loop would do nicely...
2. Re: A Euphoria wish list item (minor)
- Posted by Kat <gertie at PELL.NET> Feb 15, 2002
- 462 views
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. Kat
3. Re: A Euphoria wish list item (minor)
- Posted by mistertrik at hotmail.com Feb 16, 2002
- 493 views
>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
4. Re: A Euphoria wish list item (minor)
- Posted by Euler German <efgerman at myrealbox.com> Feb 16, 2002
- 506 views
Hi Andy! 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... > > 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 > exit_flag = TRUE > exit > end if > end for > if exit_flag = TRUE then > exit > end if > end for > > ...wheras a nice "exit(2)" inside the j loop would do nicely... > That's the kind of minor suggestion that'll produce a major result. Besides that, I'm quite confident that is also easier to achieve, won't slow interpreter (I'm afraid it could go faster) and won't modify language structure. With these possibilities, to convince Rob to include it at v2.4 will be a lot more easy, don't you agree Rob? -- Euler
5. Re: A Euphoria wish list item (minor)
- Posted by tone.skoda at siol.net Feb 16, 2002
- 488 views
That exit (2) was my idea one year ago back in January 2001 (strange how years fly by fast). I originally proposed two or more exit statements followed: while .. do while .. do exit exit end while end while or: while .. do while .. do exit (2) end while end while You can search for "exiting out of nested loops" in subject in e-mail archives if you are interested. ----- Original Message ----- From: <mistertrik at hotmail.com> To: "EUforum" <EUforum at topica.com> Sent: Sunday, February 17, 2002 3:22 AM Subject: Re: A Euphoria wish list item (minor) > > >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 > > > >