Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdearman committed May 15, 2024
1 parent f52a245 commit 4bbc90d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/mvp.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

(def (fib n)
(if (<= n 1)
n
(+ (fib (- n 1)) (fib (- n 2)))))
n
(+ (fib (- n 1)) (fib (- n 2)))))

(def (fib-iter n)
(let loop ((a 0) (b 1) (i n))
Expand Down Expand Up @@ -89,6 +89,9 @@
;; maps
{:a 1 :b 2}

;; this is equivalent to
(Map.new :a 1 :b 2)

;; Maps that use keyword symbols as keys are called records.
;; Keywords are symbols that evaluate to themselves they
;; are used to represent named arguments and are often
Expand All @@ -108,6 +111,9 @@
;; sets
#{1 2 3}

;; this is equivalent to
(Set.new 1 2 3)

;; Macros are rules for transforming terms at compile time.
;; They are used to define new syntax and to optimize code.
;; Macros are defined using the `macro` special form.
Expand Down

0 comments on commit 4bbc90d

Please sign in to comment.