summaryrefslogtreecommitdiff
path: root/res/builtins.lisp
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-30 00:12:27 +0200
committerLinnea Gräf <nea@nea.moe>2024-04-30 00:12:27 +0200
commitb51321b27fdf513a3de09d084bbd4e69a26fb76e (patch)
tree873c433cc96e382321736fe0bcb4e2948789ced6 /res/builtins.lisp
parent37d5b9ce0acf6eb25162c097990983f388ec3a19 (diff)
downloadnealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.tar.gz
nealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.tar.bz2
nealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.zip
Add lists
Diffstat (limited to 'res/builtins.lisp')
-rw-r--r--res/builtins.lisp14
1 files changed, 13 insertions, 1 deletions
diff --git a/res/builtins.lisp b/res/builtins.lisp
index 19bab1f..f6e2bba 100644
--- a/res/builtins.lisp
+++ b/res/builtins.lisp
@@ -62,4 +62,16 @@
(def hash.get core.gethash)
(export hash.new hash.merge hash.get)
-
+(comment "Re-export List operations")
+(def list.new core.list.new)
+(def list.slice core.list.slice)
+(def list.length core.list.length)
+(def list.join core.list.join)
+(def list.at core.list.at)
+(defun list.map (list func)
+ (if [= 0 (list.length list)]
+ (list.new)
+ (list.join
+ (list.new (func (list.at list 0)))
+ (list.map (list.slice list 1 (list.length list)) func))))
+(export list.new list.slice list.length list.join list.at list.map)