Re: [Vala] Suggestion: first {} and last {} operators in iteration-loops
- From: "Nigel Tao" <nigel tao gnome gmail com>
- To: "Raphael Bosshard" <raphael bosshard gmail com>
- Cc: vala paldo org
- Subject: Re: [Vala] Suggestion: first {} and last {} operators in iteration-loops
- Date: Mon, 10 Sep 2007 11:42:44 +1000
/* With first{} and last{} */
static int main (string[] args) {
foreach (string arg in args) {
stdout.printf("%s is a string", arg);
first {
stdout.printf("%s is the first string", arg);
}
last {
stdout.printf("%s is the last string", arg);
}
}
return 0;
}
With this syntax, is stdout.printf("%s is a string", arg); also run on
the first and last elements? What happens if args is 1 element long,
so the first element is the last element - do all three printfs get
called?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]