Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdearman committed Jun 5, 2024
1 parent a04364e commit b4933c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/mvp.scm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
n
(+ (fib (- n 1)) (fib (- n 2)))))

(def (fib 0) 0)
(def (fib 1) 1)
(def (fib n) (+ (fib (- n 1)) (fib (- n 2))))

(def (gcd a 0) a)
(def (gcd a b) (gcd b (% a b)))

(def (map f []) [])
(def (map f (x . xs)) (:: (f x) (map f xs)))

(def (fib n)
(if (<= n 1)
n
Expand Down

0 comments on commit b4933c1

Please sign in to comment.