aboutsummaryrefslogtreecommitdiff
path: root/src/example/test1.lang
diff options
context:
space:
mode:
Diffstat (limited to 'src/example/test1.lang')
-rw-r--r--src/example/test1.lang9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/example/test1.lang b/src/example/test1.lang
index f6f244a57..da3d3fa87 100644
--- a/src/example/test1.lang
+++ b/src/example/test1.lang
@@ -1,6 +1,9 @@
(* 5 6)
-(defdata (List x)
- (#Nil [])
- (#Cons [x] (List x)))
+(def (repeat n val)
+ (if (<=' n 0)
+ (#Nil [])
+ (#Cons [val (repeat (-' n 1) val)])))
+
+(repeat 5 5)