Re: New switch/case idea

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

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?

Jeremy

break is still useful for getting out of nested if statements.

However, it is hard to see a use of break for a single if-statement.

Perhaps we could only allow break to break out of an if-statement if a label is used, otherwise it defaults to break out of the switch (and is an error if there is no label and no switch).

Still, I'm a bit leery about doing this.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu