1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-26 14:22:25 +03:00

mal: implement macro? with contains? instead of list equality

This is more efficient, and avoids triggering some bugs (see #400).
This commit is contained in:
Nicolas Boulenguez 2019-07-15 19:46:10 +02:00
parent 809d74cba7
commit 72a66d2e60

View File

@ -1,11 +1,11 @@
(def! _map? (fn* [x]
(if (map? x)
(not (= (keys x) '(:__MAL_MACRO__)))
(not (contains? x :__MAL_MACRO__))
false)))
(def! _macro? (fn* [x]
(if (map? x)
(= (keys x) '(:__MAL_MACRO__))
(contains? x :__MAL_MACRO__)
false)))
(def! core_ns