diff --git a/tmp/example.lisp b/stdlib/stdlib.lisp similarity index 80% rename from tmp/example.lisp rename to stdlib/stdlib.lisp index c481377..149eff4 100644 --- a/tmp/example.lisp +++ b/stdlib/stdlib.lisp @@ -1,5 +1,5 @@ ; quicksort -(defun qs (l) +(defun quick-sort (l) (if (<= (len l) 1) l (do @@ -13,8 +13,10 @@ ; decrement a number (defun dec (n) (- n 1)) + ; increment a number (defun inc (n) (+ n 1)) + ; not a bool (defun not (x) (if x 0 1)) @@ -23,12 +25,8 @@ ; is a number positive? (defun is-pos? (n) (> n 0)) + ; is a number negative? (defun is-neg? (n) (< n 0)) -; define a function `fact` that takes an argument `n` -(defun fact (n) - (if (<= n 1) - 1 - (* n (fact (- n 1))) - )) +