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:
parent
edc9b5dedd
commit
5f905bacfd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user