projects
/
rune.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Rune - Content-locking work 1/2
[rune.git]
/
tests
/
nested.d
1
#!/usr/local/bin/rune -x
2
#
3
# nested procedures
4
5
limport "sys";
6
import "stdio";
7
8
alias stdio.File *stdout = stdio.stdout;
9
10
void
11
main()
12
{
13
int i;
14
int j = 1;
15
int k = 2;
16
17
int
18
subfubar()
19
{
20
stdout->show(i + j + k);
21
j = j + k;
22
}
23
24
stdout->show("should get: 3 6 9 12 15 18 21 24 27 30");
25
for (i = 0; i < 10; ++i) {
26
subfubar();
27
}
28
stdout->show("j should be 21:", j);
29
}