Re: switch bug?

new topic     » goto parent     » topic index » view thread      » older message » newer message
? said...

Can we also have the select statement, that doesn't fall through.

I tried to argue for a non-fallthru switch statement too. In my opinion, the fall through should be explicit and not implicit. Something like ...

switch val do 
   case 1: 
       DoOne() 
   case 2: 
       DoTwo() 
       fallthru 
   case 3: 
       DoThree() 
end switch 

But it was rejected on the grounds (IIRC) that it was not C-like and therefore unfamiliar, and we would also need case clauses that handled lists ...

switch val do 
   case 1, 2: 
       DoOneTwo() 
   case 3: 
       DoThree() 
end switch 

And my response to those were "this is Euphoria not C", and "Excellent idea, let's have lists".

I did not win out on this one.

I also wanted to have Euphoria issue a warning if case else was omitted. But this is an exercise in collective productivy, and from time to time we all need to make concessions.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu