foreach ... else statement

Tomas Lindquist Olsen tomas.l.olsen at gmail.com
Wed Jan 7 07:49:01 PST 2009


On Wed, Jan 7, 2009 at 6:07 AM, Walter Bright <newshound1 at digitalmars.com>wrote:

> Don wrote:
>
>> I still avoid goto because I was told to. But eventually I realised that
>> it's 100% propaganda. I actually think my code would be cleaner if I used
>> it; it would allow lots of local flag variables to be eliminated.
>> But I still have this residual prejudice against 'goto' which is really
>> hard to get rid of.
>>
>
> The problem with goto is it is easy to get into a human readability problem
> with it. No such problem exists for optimization algorithms.
>
>
>  Yes, but I doubt any compiler would have a problem with goto.
>>
>
> The last time I even heard of a compiler that fell over and gave up
> optimizing if it saw a goto was in the early 80's. I have a hard time
> believing LDC has problems with it, but if it does, the authors should hit
> the books <g>.
>

It doesn't :P


>
> I keep thinking I should put on a "Compiler Construction" seminar!
>
> P.S. There are problems with goto'ing out of a finally block, and there's a
> problem in the optimizer with goto'ing from one try block to another, but
> that's not the issue here.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090107/6a72df71/attachment.html>


More information about the Digitalmars-d mailing list