Re: The fate of Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 9 Nov 2004, at 10:26, Patrick Barnes wrote:

> 
> > Patrick:
> >    Where did you find "  next(N)  " instruction ?
> > 
> > Bernie
> 
> I said... *IF* they are available. Unfortunately Rob hasn't
> implemented all of the high-level program flow constructs.
> }}}
<eucode>
> for a = 1 to 10 do
>           *lots of code*
>            if something then [I want to skip the rest of the block,
> but stay within the loop] end if
>            *lots more code*
> end for
> </eucode>
{{{

> 
> At the moment, we have to encase the 'lots more code' within an if
> statement. Unfortunately, this often leads to horrible amounts of
> indenting. In C and Java, the 'continue' statement causes the program
> to start executing again at the beginning of the loop, incrementing
> the loop variable.
> In Euphoria, hopefully ''next' or 'continue' could do the same thing...

A goto by any other name, but mine must spec unequivically and exactly 
where it goes to, your continue and next will need to be altered if you add 
significant code. You want a continue, break, next, exit, resume, hop, skip, 
blah, blah, blah, but no goto??!!?? Goto can replace ALL those!
 
> The other thing missing is control over the exit/next statement's
> scope. If you have this:
> }}}
<eucode>
> for x = 1 to SCREEN_WIDTH do
> for y = 1 to SCREEN_HEIGHT do
>          *code*
>          *code*
>           [I've found what I'm looking for, I want to exit out of
> these 'for' loops]
GOTO EOLOOP
>          *code*
> end for
> end for
:EOLOOP
> </eucode>
{{{

> Using just plain 'exit' won't work. You need to do this:

Nope, just use a goto.
<snip>

> That way, exit( label ) would move out of the loop with that label,

But that's a goto !!!!!!

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu