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:
parent
b6fce2eea0
commit
20bd0392b9
@ -5,6 +5,7 @@
|
||||
(:export :undefined-symbol
|
||||
:mal-environment
|
||||
:get-env
|
||||
:find-env
|
||||
:set-env))
|
||||
|
||||
(in-package :env)
|
||||
|
@ -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)))))))
|
||||
|
@ -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)))))))
|
||||
|
@ -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)))))))
|
||||
|
Loading…
Reference in New Issue
Block a user