Skip to content

Commit 3cb3d56

Browse files
committed
feat: Add let-traced
1 parent b15009d commit 3cb3d56

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/gen/dynamic.clj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,14 @@
208208
:else
209209
form))
210210
body)))))
211+
212+
(defmacro let-traced
213+
[bindings & body]
214+
(let [bents (partition 2 bindings)]
215+
(assert (every? symbol? (map first bents)))
216+
(assert (every? call? (map second bents)))
217+
`(let ~(into []
218+
(mapcat (fn [[sym expr]]
219+
[sym `(gen/trace (quote ~sym) ~expr)]))
220+
bents)
221+
~@body)))

0 commit comments

Comments
 (0)