1 ;; Testing nth, first and rest functions
8 (def! x (nth '(1 2) 2))
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)
83 (cond false 7 false 8 "else" 9)
85 (cond false 7 (= 2 2) 8 "else" 9)
87 (cond false 7 false 8 false 9)
90 ;; Testing macroexpand
91 (macroexpand (unless2 2 3 4))
96 (load-file "../core.mal")
111 (and 1 2 3 4 false 5)
118 (-> (list 7 8 9) first)
120 (-> (list 7 8 9) (first))
122 (-> (list 7 8 9) first (+ 7))
124 (-> (list 7 8 9) rest (rest) first (+ 7))
127 ;; Testing EVAL in let*
129 (let* (x (or nil "yes")) x)
133 ;; -------- Optional Functionality --------
135 ;; Testing nth, first, rest with vectors
142 (def! x (nth [1 2] 2))
159 ;; Testing EVAL in vector let*
161 (let* [x (or nil "yes")] x)