Anoying problem, but what else can be done?
    BCS 
    ao at pathlink.com
       
    Sat Feb  3 17:20:18 PST 2007
    
    
  
Reply to Frits,
> BCS wrote:
> 
> Perhaps your proposed syntax could still be implemented as an
> additional
> feature allowing you to jump to other iterations, but I think the
> original should just do the "obvious" thing.
> Again, if implemented it should also apply to other declarations, not
> just labels.
> I ran into a similar situation a few days ago when I declared an alias
> in a 'static' foreach. It kept using the alias from the first
> iteration for all subsequent iterations (IIRC not even a 'duplicate
> definition' error!).
> 
Ouch!
BTW I'm working on a program that uses a bunch of this kind of stuff so they 
are real concerns. (Code forthcoming <g>)
OTOH it still has to use the case trick because it needs to do a "goto case 
n;" for a non const n, (this doesn't work so I have to wrap the switch in 
a while(true) and fall out the bottom). Now I'm wishing for label variables 
like in C++ under gcc:
void* to = forever ? loop : dont;
loop: goto to;
dont:;
    
    
More information about the Digitalmars-d
mailing list