Skip to content

Commit

Permalink
started core and math libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
hscells committed Oct 19, 2015
1 parent 1bc7251 commit 2cb2b20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zlib/core.zap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

(fn empty? (l)
(cond
((= 0 (length l)) (return True))
(True (return False))))
9 changes: 9 additions & 0 deletions zlib/math.zap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(let PI 3.141519)

(fn dec (n) (- n 1))
(fn inc (n) (+ n 1))

(fn pow (n exponent)
(cond
((<= exponent 1) (return n))
(True (* n (pow n (dec exponent)))))

0 comments on commit 2cb2b20

Please sign in to comment.