2 ms·
Vala does have optional parameters! Maybe it wasn't there in the initial version, and now the core API is stabalized so they don't use it for that call? Here i
by capableweb 4y ago
Vala does have optional parameters! Maybe it wasn't there in the initial version, and now the core API is stabalized so they don't use it for that call?
Here is a random example I found on the interwebs:
string greet (string name, string language = "English") {
if (language == "English") {
return @"Hello, $name!";
} else {
return @"Sorry $name, I don't speak $language";
}
}
greet ("John");
greet ("Jane", "Italian");