aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-01-20 22:30:57 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-01-20 22:30:57 +0100
commit5d43ce4ab4b9c8d3ca8a0cb21f99b25e87e58fb4 (patch)
treeb9584bbf1ba6ad82139101f4e74e8749cdac078e /tests
parentd13695d2452e0468168240800a4cde88f220b646 (diff)
downloadsylt-5d43ce4ab4b9c8d3ca8a0cb21f99b25e87e58fb4.tar.gz
Calling of functions, in functions
Diffstat (limited to 'tests')
-rw-r--r--tests/simple.tdy22
1 files changed, 7 insertions, 15 deletions
diff --git a/tests/simple.tdy b/tests/simple.tdy
index f7929f4..28bd5e2 100644
--- a/tests/simple.tdy
+++ b/tests/simple.tdy
@@ -1,19 +1,11 @@
-a : fn int, int -> int = fn b: int, c: int -> int {
- ret b + c
+fac : fn int -> int = fn a: int -> int {
+ if a <= 1 {
+ ret 1
+ }
+ b := fac(a - 1)
+ ret a * b
}
-
-print a(1, 2) + 1
-
-b := fn c: fn int -> -> int {
- c(2)
- ret 1
-}
-
-c := fn a: int {
- print a
-}
-
-b(c)
+print fac(5)
// print b(fn a: int -> {
// print a