summaryrefslogtreecommitdiff
path: root/res/builtins.lisp
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-08-11 14:03:19 +0200
committernea <nea@nea.moe>2023-08-11 14:03:19 +0200
commit3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62 (patch)
tree7ca3fc4ac01c78839e269b3432f565ee0c31347b /res/builtins.lisp
parent69f8367389c9d6f60ca594053d9d470e5a8ec999 (diff)
downloadnealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.tar.gz
nealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.tar.bz2
nealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.zip
Restructure core bindings
Diffstat (limited to 'res/builtins.lisp')
-rw-r--r--res/builtins.lisp32
1 files changed, 27 insertions, 5 deletions
diff --git a/res/builtins.lisp b/res/builtins.lisp
index 1564e62..d1828f6 100644
--- a/res/builtins.lisp
+++ b/res/builtins.lisp
@@ -1,7 +1,33 @@
-(defun comment (...) ((pure nil)))
+(core.defun comment (...) ((core.pure core.nil)))
(comment "comment is a noop function for documentation")
(export comment)
+(comment "Re-exports from core")
+(core.def def core.def)
+(def defun core.defun)
+(def if core.if)
+(def nil core.nil)
+(def stringify core.tostring)
+(def pure core.pure)
+(def lambda core.lambda)
+(def seq core.seq)
+(def import core.import)
+(def debuglog core.debuglog)
+(export def defun if nil stringify pure lambda seq import debuglog)
+
+(comment "Re-exports from arithmetic")
+(def + core.arith.add)
+(def / core.arith.div)
+(def * core.arith.mul)
+(def - core.arith.sub)
+(def = core.arith.eq)
+(def lt core.arith.less)
+(export + / * - = lt)
+
+(comment "comparisons")
+(defun gt (l r) (lt r l))
+(export gt)
+
(comment "if! a strict version of a regular if, meaning it evaluates both the falsy and the truthy case, instead of only one.")
(defun if! (cond ifTrue ifFalse) (if cond ifTrue ifFalse))
@@ -26,7 +52,3 @@
(defun not (v) (if v false true))
(defun ^ (l r) (if l (not r) r))
(export | & not ^)
-
-(comment "comparisons")
-(defun gt (l r) (lt r l))
-(export gt)