On Thu, Jan 24, 2013 at 10:24 PM, Flemming Richter Mikkelsen
<[email protected]> wrote:
> On Thu, Jan 24, 2013 at 10:14 PM, Nelson, Jim <[email protected]> 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.
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to