This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-08
Channels
- # announcements (1)
- # babashka (28)
- # beginners (13)
- # calva (10)
- # clerk (18)
- # clj-on-windows (39)
- # clj-otel (1)
- # cljdoc (17)
- # clojars (12)
- # clojure (40)
- # clojure-austin (11)
- # clojure-brasil (1)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-norway (16)
- # clojure-uk (2)
- # clojurescript (28)
- # clr (4)
- # conjure (1)
- # emacs (14)
- # hoplon (6)
- # hyperfiddle (59)
- # interop (2)
- # leiningen (1)
- # off-topic (37)
- # pathom (1)
- # polylith (5)
- # portal (7)
- # reagent (9)
- # releases (3)
- # shadow-cljs (22)
- # spacemacs (6)
- # tools-build (12)
- # tools-deps (51)
- # web-security (6)
- # xtdb (7)
Hi,
I think I remember seeing a macro somewhere in one of the clojure libraries in the main distribution or in portal itself that:
1. tap>
s a value but then returns the tapped value instead of true, so that I can enclose any form in the macro and not affect code function.
2. also logs the form itself as well as the returned value and/or the line number, file name where the tap>
happens and more.
In the same library there were macros for tapping threaded expressions as well I think.
Am I misremembering or can someone point me to the macro(s).
J
just what I was looking for 🙂
thanks a lot for the great work @U1G869VNV
FWIW (doto tap>)
in a ->
pipeline will do what you want:
(-> expr
(doto tap>) ; tap expr
(process) ; process expr
(doto tap>)) ; tap result
(although that won't handle exceptions the same way portal.console/log
does)
oh, that's handy thanks @U04V70XH6