implementing calls and functions (ch24)

This commit is contained in:
2024-08-28 16:25:01 +02:00
parent 732e0861b5
commit 3daa675f8d
11 changed files with 252 additions and 46 deletions

View File

@ -0,0 +1,4 @@
fun areWeHavingItYet() {
print "Yes we are!";
}
print areWeHavingItYet;

View File

@ -0,0 +1,9 @@
fun helloWorld(var_str, var_int) {
var b = 1;
print var_str + " blah";
return b + var_int;
}
var c = helloWorld("a", 42);
print c;

View File

@ -0,0 +1,7 @@
fun a() { b(); }
fun b() { c(); }
fun c() {
c("too", "many");
}
a();

View File

@ -0,0 +1,3 @@
fun a(a, b) { var c = a + b; return c; }
print a(2, 4);
print a(4, 6);