[Vala] [PATCH] Allowing regex literals as case labels in switch statements
- From: Carlo Teubner <carlo teubner gmail com>
- To: vala-list gnome org
- Subject: [Vala] [PATCH] Allowing regex literals as case labels in switch statements
- Date: Sun, 18 Jul 2010 15:44:46 +0000 (UTC)
https://bugzilla.gnome.org/show_bug.cgi?id=624673
This is a patch to add this feature, borrowed from Ruby. Now you can say things
like:
var language = "vala";
switch (language) {
case "C":
print("boring\n");
break;
case /^C[+#]+$/:
print("still boring\n");
break;
case /[lv]a[lv]a/:
print("OMG LAVA! RUN!\n");
break;
}
Please consider for inclusion in the next release.
Cheers,
Carlo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]