1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00

Test that defining a macro does not mutate an existing function.

This commit is contained in:
Nicolas Boulenguez 2019-05-14 18:39:42 +02:00
parent edc9b5dedd
commit 5f905bacfd

View File

@ -173,3 +173,12 @@ x
(->> [4] (concat [3]) (concat [2]) rest (concat [1]))
;=>(1 3 4)
;; Test that defining a macro does not mutate an existing function.
(def! f (fn* [x] (number? x)))
;=>#<function (x) -> (number? x)>
(defmacro! m f)
;=>#<macro (x) -> (number? x)>
(f (+ 1 1))
;=>true
(m (+ 1 1))
;=>false