From 54b0f2ea841d2ce3895713415481271aa3034b30 Mon Sep 17 00:00:00 2001 From: nea Date: Tue, 15 Aug 2023 20:24:01 +0200 Subject: Add support for hex literals --- res/builtins.lisp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'res/builtins.lisp') diff --git a/res/builtins.lisp b/res/builtins.lisp index 64c59d3..19bab1f 100644 --- a/res/builtins.lisp +++ b/res/builtins.lisp @@ -28,6 +28,9 @@ (defun gt (l r) (lt r l)) (export gt) +(comment "The absolute value returns the argument if it is non negative or (- 0 arg) if it is") +(defun abs (arg) (if (lt arg 0) (- 0 arg) arg)) +(export abs) (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)) -- cgit