aboutsummaryrefslogtreecommitdiff
path: root/core.neb
diff options
context:
space:
mode:
Diffstat (limited to 'core.neb')
-rw-r--r--core.neb12
1 files changed, 12 insertions, 0 deletions
diff --git a/core.neb b/core.neb
index e2678fb..4bbb63e 100644
--- a/core.neb
+++ b/core.neb
@@ -5,6 +5,15 @@
(func ++ (num) (+ num 1))
(func -- (num) (- num 1))
+(func min (lst)
+ (reduce
+ (lambda (acc x)
+ (if (< x acc)
+ x
+ acc))
+ (rest lst)
+ (first lst)))
+
; strings
(func join (lst joiner)
; TODO this doesn't handle empty lists
@@ -26,6 +35,9 @@
(#true str)))
; lists
+(func extend (lst1 lst2)
+ (reduce append lst2 lst1))
+
(func slice (lst idx)
; TODO doesn't handle lengths
(if (eq? 1 idx)