1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 10:07:45 +03:00

Use find-env instead of get-env in is-macro-call

Apparently the earlier approach with all its error handling is slower
This commit is contained in:
Iqbal Ansari 2016-08-28 20:09:20 +05:30
parent b6fce2eea0
commit 20bd0392b9
4 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@
(:export :undefined-symbol
:mal-environment
:get-env
:find-env
:set-env))
(in-package :env)

View File

@ -89,7 +89,7 @@
(not (zerop (length (mal-data-value ast)))))
(let* ((func-symbol (first (mal-data-value ast)))
(func (when (types:mal-symbol-p func-symbol)
(ignore-errors (env:get-env env func-symbol)))))
(env:find-env env func-symbol))))
(and func
(types:mal-fn-p func)
(cdr (assoc 'is-macro (types:mal-data-attrs func)))))))

View File

@ -89,7 +89,7 @@
(not (zerop (length (mal-data-value ast)))))
(let* ((func-symbol (first (mal-data-value ast)))
(func (when (types:mal-symbol-p func-symbol)
(ignore-errors (env:get-env env func-symbol)))))
(env:find-env env func-symbol))))
(and func
(types:mal-fn-p func)
(cdr (assoc 'is-macro (types:mal-data-attrs func)))))))

View File

@ -89,7 +89,7 @@
(not (zerop (length (mal-data-value ast)))))
(let* ((func-symbol (first (mal-data-value ast)))
(func (when (types:mal-symbol-p func-symbol)
(ignore-errors (env:get-env env func-symbol)))))
(env:find-env env func-symbol))))
(and func
(types:mal-fn-p func)
(cdr (assoc 'is-macro (types:mal-data-attrs func)))))))