Re: [Vala] Request for new keyword "nobreak"
- From: Flemming Richter Mikkelsen <frm member fsf org>
- To: vala-list gnome org
- Subject: Re: [Vala] Request for new keyword "nobreak"
- Date: Thu, 24 Jan 2013 22:36:10 +0100
On Thu, Jan 24, 2013 at 10:24 PM, Flemming Richter Mikkelsen
<frm member fsf org> wrote:
On Thu, Jan 24, 2013 at 10:14 PM, Nelson, Jim <jim yorba org> wrote:
Apparently this is possible in C# with the "goto case <label>" syntax:
http://stackoverflow.com/questions/174155/switch-statement-fallthrough-in-c
Doesn't work in Vala, however.
I'm not advocating for switch-case fallthrough, but C# was able to provide
it without reserving another keyword.
I know about that C# hack, but I think it is a rather ugly and as you
said, does not work in Vala.
One other way, would be to allow case fallthrough and give warnings
instead of errors.
That way, the programmer would also know if he/she forgot the break keyword.
As I understand it, the main reason for removing case fallthrough, was
to elliminate errors due to missing break statements.
In general, I don't use case fallthrough much, but in some (rare)
situations it makes very much sense. And as I see it, Vala is
limiting the programmer from writing clean code in those situations.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]