Re: New switch/case idea

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

Yes, I suppose it doesn't make much sense. We could ignore the first if block for a naked break, but that might lead to more confusion than it's worth, due to the changing nature of break.

I wonder, not changing it, because it would indeed be confusing, but giving a warning if a break is given inside of an if statement w/no label? It almost always means an error. In fact, it would always mean an error? Maybe it should be an error actually? When would it ever be a good thing?

It could be 'useful' if you jumped around using goto.

Matt

LOL grin

Go wash your mouth out with soap right now young man.

  if cond then 
      goto "A" 
    label "C" 
      proc1() 
      break 
    label "B" 
      proc2() 
      goto "C" 
    label "A" 
      proc3() 
      goto "B" 
  end if 

... preparing the gallows as we speak ...

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

Search



Quick Links

User menu

Not signed in.

Misc Menu