comparison graal/com.oracle.truffle.sl.test/tests/LoopPolymorphic.sl @ 13836:64c77f0577bb

More documentation and improvements of Simple Language
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 30 Jan 2014 17:53:27 -0800
parents
children afd6fa5e8229
comparison
equal deleted inserted replaced
13835:67e4e7f56911 13836:64c77f0577bb
1 function add(a, b) {
2 return a + b;
3 }
4
5 function loop(n) {
6 i = 0;
7 while (i < n) {
8 i = add(i, 1);
9 }
10 return i;
11 }
12
13 function main() {
14 add("a", "b");
15 println(loop(1000));
16 }