1 ;; Testing nth, first and rest functions
27 ;; Testing non-macro function
30 ;;; This should fail if it is a macro
35 ;; Testing trivial macros
36 (defmacro! one (fn* () 1))
39 (defmacro! two (fn* () 2))
43 ;; Testing unless macros
44 (defmacro! unless (fn* (pred a b) `(if ~pred ~b ~a)))
49 (defmacro! unless2 (fn* (pred a b) `(if (not ~pred) ~a ~b)))
66 (or false nil false false nil 4)
68 (or false nil 3 false nil 4)
81 (cond false 7 false 8 "else" 9)
83 (cond false 7 (= 2 2) 8 "else" 9)
85 (cond false 7 false 8 false 9)
88 ;; Testing macroexpand
89 (macroexpand (unless2 2 3 4))
94 (load-file "../core.mal")
109 (and 1 2 3 4 false 5)
116 (-> (list 7 8 9) first)
118 (-> (list 7 8 9) (first))
120 (-> (list 7 8 9) first (+ 7))
122 (-> (list 7 8 9) rest (rest) first (+ 7))
125 ;; Testing EVAL in let*
127 (let* (x (or nil "yes")) x)
131 ;; -------- Optional Functionality --------
133 ;; Testing nth, first, rest with vectors
157 ;; Testing EVAL in vector let*
159 (let* [x (or nil "yes")] x)