Re: 3.0 feature request: foreach

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

> Subject: Re: 3.0 feature request: foreach
> 
> 
> posted by: Ferlin Scarborough <ferlin1 at bellsouth.net>
> 
> Kat wrote:
> 
>>> 
>>> On 13 Jul 2005, at 20:48, Ferlin Scarborough wrote:
>>> 
>>> There's only 2 gotos, and they replaced all those ugly case statements!
>>> 
>>> Kat
>>> 
> 
> I was just picking at you, I know how much of an advocate you are for the goto
> statement.  Personally, the only real thing I have against goto is that 98% of
> the programmers that use a language that contains goto, ABUSE it, and end up with
> all kinds of speghetti code, that you get lost in because they branch all over
> Gods creation.
> 
> Now, if there was a way to implement the goto, and prevent abuse and over
> usage of it, then I would be all for that, but then, that is practically
> impossible.  grin
> 
> Later.
> 
> Ferlin Scarborough
> 

The latest version of the OpenEu specs require any goto statement to 
have its owbn label.
This has imho the following advantages:
* provide a typing disincentive to using it;
* allow come_from() to tell the program what's the last goto that was 
taken. This would eliminate nearly all the ugly flags that crop up when 
you modify code built using goto;
* allow come_back() to take you to the statement that follows the last 
taken gogo branch. This allows using some code both as main and 
routine-like.

there's a goto_clear() to avoid spurious results from come_from() and 
come_back(), as well as "far" versions to go to top level code in 
included files (namespaces actually) from anywhere.

Nothing implemented yet, coders invited to visit oedoc.free.fr

CChris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu