Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-23 Thread Justin Spahr-Summers
On Tue, 22 Jun 2010 09:17:57 -0400, Adam Ruppe destructiona...@gmail.com wrote: What you guys are saying makes enough sense. switch will always be a series of labels and jumps in my mind, but I can deal with this. One note that I think is the main reason people find fallthrough confusing:

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Lars T. Kyllingstad
On Mon, 21 Jun 2010 20:27:32 -0700, Bill Baxter wrote: On Mon, Jun 21, 2010 at 6:31 PM, Leandro Lucarella l...@llucax.com.ar wrote: Bill Baxter, el 21 de junio a las 17:13 me escribiste: On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella l...@llucax.com.ar wrote: goto next case; is a

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Steven Schveighoffer
On Mon, 21 Jun 2010 20:40:14 -0400, Adam Ruppe destructiona...@gmail.com wrote: What's the point of a switch without implicit fallthrough? Maintenance. Using if statements instead of switch, you have to repeat the value to test for each of the cases. If you want to change the value

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Jeff Nowakowski
On 06/22/2010 12:06 AM, Don wrote: Finally, goto is ugly and continue is strongly associated with looping. ? It's most commonly used in error handling. But, fallthrough actually is a goto. Do I really have to argue that goto is mostly deprecated, and has been for decades? Lots of

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Simen kjaeraas
On Tue, 22 Jun 2010 02:40:14 +0200, Adam Ruppe destructiona...@gmail.com wrote: What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Don
Jeff Nowakowski wrote: On 06/22/2010 12:06 AM, Don wrote: Finally, goto is ugly and continue is strongly associated with looping. ? It's most commonly used in error handling. But, fallthrough actually is a goto. Do I really have to argue that goto is mostly deprecated, and has been for

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Leandro Lucarella
Steven Schveighoffer, el 22 de junio a las 07:26 me escribiste: On Mon, 21 Jun 2010 20:40:14 -0400, Adam Ruppe destructiona...@gmail.com wrote: What's the point of a switch without implicit fallthrough? Maintenance. Using if statements instead of switch, you have to repeat the value to

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Leandro Lucarella
Lars T. Kyllingstad, el 22 de junio a las 09:14 me escribiste: On Mon, 21 Jun 2010 20:27:32 -0700, Bill Baxter wrote: On Mon, Jun 21, 2010 at 6:31 PM, Leandro Lucarella l...@llucax.com.ar wrote: Bill Baxter, el 21 de junio a las 17:13 me escribiste: On Mon, Jun 21, 2010 at 4:24 PM,

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Adam Ruppe
What you guys are saying makes enough sense. switch will always be a series of labels and jumps in my mind, but I can deal with this. One note that I think is the main reason people find fallthrough confusing: they hit tab once too many times. switch(a) { case 10: case 20: // obvious

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-22 Thread Jeff Nowakowski
On 06/22/2010 08:39 AM, Don wrote: I think you misunderstood. I was arguing that there is no association between 'goto' and loops. People who use goto, use it for error handling, not for looping. I was by no means advocating the use of goto for error handling! Oh good :) The looping part

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
KennyTM~ wrote: On Jun 19, 10 07:17, Jonathan M Davis wrote: bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case since it's more explicit and less error

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread bearophile
Sean Kelly: Having never encountered D before, what would be your interpretation of this code? Unfortunately the continue case; syntax looks about equally unintuitive to me :-( Bye, bearophile

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for it when I have time. Walter just

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:08 PM, Don wrote: Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Ellery Newcomer
On 06/21/2010 03:46 PM, Sean Kelly wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case since it's more

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:46 PM, Sean Kelly wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Jonathan M Davis wrote: Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Don wrote: But 'goto case XXX' is an extremely rarely encountered construct, that screams 'Examine this code closely'. So I don't think it needs extra error checking. Oh, I don't think that it's a big issue. We have goto case XXX and goto case, so we could use them to enforce flow control

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Jonathan M Davis Wrote: Sean Kelly wrote: It's a small thing, but I think continue switch could be misleading. Consider this: switch (getState()) { case X: setState(Z); continue switch; case Y: break; case Z: writeln( done! ); } Having never

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 04:15 PM, Don wrote: Jonathan M Davis wrote: Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Andrei Alexandrescu wrote: After Sean's example, goto case XXX is my fave for fallthrough. I don't like unlabeled goto case to mean fall through, it's one of those need to look in the manual features. goto case XXX is generalized fall through. Andrei Well, it definitely works, but then

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:01 PM, Jonathan M Davis wrote: Andrei Alexandrescu wrote: After Sean's example, goto case XXX is my fave for fallthrough. I don't like unlabeled goto case to mean fall through, it's one of those need to look in the manual features. goto case XXX is generalized fall through.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jeff Nowakowski
On 06/21/2010 05:11 PM, Jonathan M Davis wrote: Having something like fallthrough or goto next case would of course be even clearer, but those would require new keywords. I think fallthrough would be a perfect keyword to add here. C programmers will immediately recognize it. Switch/case are

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the job done. So, regardless of which would be better for fallthrough, we can choose to use whichever we want in our code. As it stands, it becomes a matter of preference. I'd love

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Bill Baxter
Did anyone suggest continue case instead of continue switch? That sounds less ambiguous to me. --bb On Mon, Jun 21, 2010 at 4:56 PM, Jonathan M Davis jmdavisp...@gmail.com wrote: Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:56 PM, Jonathan M Davis wrote: Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the job done. So, regardless of which would be better for fallthrough, we can choose to use whichever we want in our code. As it stands,

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Leandro Lucarella
Andrei Alexandrescu, el 21 de junio a las 15:31 me escribiste: On 06/21/2010 03:08 PM, Don wrote: Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Bill Baxter
On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella l...@llucax.com.ar wrote: goto next case; is a little more verbose but very clear to me :) Maybe just next case; is a shorter alternative... That would be great if next were a D keyword. But I don't think you're going to get Walter to add a

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Adam Ruppe
What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function anyway, so whoop-de-doo. And I guess some performance boosts in rearranging the cases,

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 07:40 PM, Adam Ruppe wrote: What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function anyway, so whoop-de-doo. And I guess some

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Leandro Lucarella
Adam Ruppe, el 21 de junio a las 20:40 me escribiste: What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function anyway, so whoop-de-doo. And I

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Leandro Lucarella
Bill Baxter, el 21 de junio a las 17:13 me escribiste: On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella l...@llucax.com.ar wrote: goto next case; is a little more verbose but very clear to me :) Maybe just next case; is a shorter alternative... That would be great if next were a D

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread BCS
Hello Jonathan, goto case does seem a bit silly, but I think that it's clearer and less error prone for anyone who understands goto case. Say I have some code with a fall through. If I use the goto case X; version, it allows the cases to be freely reordered. OTOH if I use the other option,

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Bill Baxter
On Mon, Jun 21, 2010 at 6:31 PM, Leandro Lucarella l...@llucax.com.ar wrote: Bill Baxter, el 21 de junio a las 17:13 me escribiste: On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella l...@llucax.com.ar wrote: goto next case; is a little more verbose but very clear to me :) Maybe just

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Adam Ruppe
On 6/21/10, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Then why are people using switch and next to nobody uses fall through (provably including Walter, who thinks is using fall through all the time)? Do you have some stats from the phobos and dmd source? I ran a crude text

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Jeff Nowakowski wrote: On 06/21/2010 05:11 PM, Jonathan M Davis wrote: Having something like fallthrough or goto next case would of course be even clearer, but those would require new keywords. I think fallthrough would be a perfect keyword to add here. C programmers will immediately

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Adam Ruppe
On 6/22/10, Don nos...@nospam.com wrote: Did you consider situations where the last thing before the case is actually a 'goto' ? Walter does that a lot. Yeah, me too. I counted them the same as break (and continue, return, and throw). Here's my source. I know it has some false negatives and

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Adam Ruppe wrote: On 6/21/10, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Then why are people using switch and next to nobody uses fall through (provably including Walter, who thinks is using fall through all the time)? Do you have some stats from the phobos and dmd source? I ran

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-20 Thread Andrei Alexandrescu
On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for it when I have time. Walter just gave the green light, so Don

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread KennyTM~
On Jun 19, 10 07:17, Jonathan M Davis wrote: bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to fall through. It would be

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread Andrei Alexandrescu
On 06/18/2010 10:08 PM, Vladimir Panteleev wrote: On Sat, 19 Jun 2010 05:22:47 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Walter had no retort to that argument, so he veered into a critique of the goto case XXX solution saying it's unmaintainable: when you moving code

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread Andrei Alexandrescu
On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for it when I have time. You may want to make sure Walter

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread Justin Johansson
Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for it when I have time. You may want

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread Leandro Lucarella
Andrei Alexandrescu, el 19 de junio a las 03:15 me escribiste: On 06/18/2010 10:08 PM, Vladimir Panteleev wrote: On Sat, 19 Jun 2010 05:22:47 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Walter had no retort to that argument, so he veered into a critique of the goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-19 Thread Leandro Lucarella
Justin Johansson, el 19 de junio a las 23:24 me escribiste: Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Simen kjaeraas
Don nos...@nospam.com wrote: I was quite shocked to find that the reason is backwards compatibility with the B programming language. Surely it is important that all B code ported to D compiles correctly? :p But yes, end the madness. I fear Walter will only do it if it provably breaks no

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Tomek Sowiński
Dnia 18-06-2010 o 23:11:43 Simen kjaeraas simen.kja...@gmail.com napisał(a): But yes, end the madness. I fear Walter will only do it if it provably breaks no code, though. if (a==b c) would be flagged as error. If it breaks loudly, that's ok. Besides, it's not much used anyway. Ban it.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Andrei Alexandrescu
Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. A perhaps little known thing is that D doesn't allow this: int a, b, c; if (a b c) { ... } although it's compilable code in C. The same strategy could be

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread bearophile
Don: Tragic. Can we end this madness? Could we give | ^ the same precedence as ==, making (a mask == b) an error, just as (a b == c) is rejected? That way we could lay this common bug to rest. You can change the dmd compiler (even D1, if you want) applying this change and create a

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread bearophile
bearophile: 1 5 10 True It's especially useful when the value in the middle is the result of some function call: if 1 foo(5) 10: ... In D you have to use a temporary variable: auto aux = foo(5); if (1 aux aux 10) { ... Bye, bearophile

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to fall through. It would be horribly painful in many cases if they

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread bearophile
Jonathan M Davis: but requiring that each case end with a break would seriously restrict the usefulness of switch statements. Time ago there was a long thread about this topic (and in the meantime Walter has added the static switch that burns the fat chance to add to D2 a second safer switch

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
bearophile wrote: Jonathan M Davis: but requiring that each case end with a break would seriously restrict the usefulness of switch statements. Time ago there was a long thread about this topic (and in the meantime Walter has added the static switch that burns the fat chance to add to D2

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
Jonathan M Davis wrote: ... the simplest answer would be if you have multiple values for the variable that your switching on which should all be using the same kind. ... Yikes, that should be using the same _code_.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread bearophile
Jonathan M Davis: Well, I would pount out that you mentioning it more or less reopens the discussion, You are right, but probably Walter will not sue me for reopening an old thread ;-) In the things you are saying you seem to ignore the goto I have written two times in my answers :-) An

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread bearophile
As this (this is D syntax that you can already use): void main() { int x, y; switch (x) { case 0: y++; goto case 1; case 1: y++; default: } } Sorry, I meant something like: void main() { int x, y; switch (x) { case 0: y++; goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Andrei Alexandrescu
Jonathan M Davis wrote: bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to fall through. It would be horribly painful in many

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Robert Jacques
On Fri, 18 Jun 2010 17:03:24 -0400, Don nos...@nospam.com wrote: In the comments for bug 4077, Bugs caused by bitwise operator precedence it was asked why C gave with lower precedence than ==, when it is unintuitive and a frequent source of bugs. I was quite shocked to find that the

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Robert Jacques
On Fri, 18 Jun 2010 20:23:45 -0400, Jonathan M Davis jmdavisp...@gmail.com wrote: bearophile wrote: Jonathan M Davis: but requiring that each case end with a break would seriously restrict the usefulness of switch statements. Time ago there was a long thread about this topic (and in the

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Vladimir Panteleev
On Sat, 19 Jun 2010 05:22:47 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Walter had no retort to that argument, so he veered into a critique of the goto case XXX solution saying it's unmaintainable: when you moving code around you want to keep on falling through but

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
bearophile wrote: Jonathan M Davis: Well, I would pount out that you mentioning it more or less reopens the discussion, You are right, but probably Walter will not sue me for reopening an old thread ;-) In the things you are saying you seem to ignore the goto I have written two times

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
Andrei Alexandrescu wrote: Jonathan M Davis wrote: bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to fall through. It

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Jonathan M Davis
Vladimir Panteleev wrote: Well, if goto case XXX is unmaintainable, how about some combination of existing keywords? For example, continue switch;. Ooh. I like that. I don't know how well that would work with the grammar, but it's fairly aesthetically pleasing and definitely more

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-18 Thread Justin Spahr-Summers
On Fri, 18 Jun 2010 20:17:09 -0700, Jonathan M Davis jmdavisp...@gmail.com wrote: I, for one, _want_ case statements to be able to fall through. It would be horribly painful in many cases if they couldn't. Now, requiring a separate statement like fallthrough or somesuch instead of break