repo.or.cz
/
vala-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
D-Bus: Remove extra semicolon to avoid C warning
[vala-lang.git]
/
tests
/
methods
/
closures.vala
blob
acee5de289e015adceb9effcfeeb4aab48ae4221
1
delegate
int
Func
();
2
3
int
A
(
int
k
,
Func x1
,
Func x2
,
Func x3
,
Func x4
,
Func x5
) {
4
Func B
=
null
;
5
B
= () => {
6
k
=
k
-
1
;
7
return
A
(
k
,
B
,
x1
,
x2
,
x3
,
x4
);
8
};
9
return
k
<=
0
?
x4
() +
x5
() :
B
();
10
}
11
12
void
main
() {
13
int
result
=
A
(
10
, () =>
1
, () => -
1
, () => -
1
, () =>
1
, () =>
0
);
14
assert
(
result
== -
67
);
15
}
16