From 0b8a47a8e9493cbf66dab2f54357d071f9c41c6d Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Tue, 27 Aug 2024 17:41:26 +0200 Subject: [PATCH] [new] `get-source`: support form meta arg --- src/taoensso/encore.cljc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/taoensso/encore.cljc b/src/taoensso/encore.cljc index 44b6e260..809ee65f 100644 --- a/src/taoensso/encore.cljc +++ b/src/taoensso/encore.cljc @@ -1167,8 +1167,12 @@ "Returns {:keys [ns line column file]} source location given a macro's compile-time `&form` and `&env` vals. See also `keep-callsite`." {:added "Encore v3.61.0 (2023-07-07)"} - [macro-form macro-env] - (let [{:keys [line column file]} (meta macro-form) + [macro-form-or-meta macro-env] + (let [{:keys [line column file]} + (if (map? macro-form-or-meta) + (do macro-form-or-meta) + (meta macro-form-or-meta)) + file (if-not (:ns macro-env) *file* ; Compiling clj