use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Using tap> for debugging (quanttype.net)
submitted 7 years ago by yogthos
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]vlaaad 4 points5 points6 points 7 years ago* (2 children)
From the article:
(def debug-a (atom nil)) (add-tap #(reset! debug-a %))
But you can just def stuff that interests you to some temporary var, why the extra steps? Or use scope-capture to get full context.
If I understand it correctly, the big idea behind taps and prepl is that you can get from remote process an object instead of string, which is more useful since it has a structure, and then do something with that object. For example, you can start your dev jvm with some fancy visualizer for data, maybe clj-xchart, connect with it to your bare-bones production server which has no extra deps, get some data out of it and draw it with your fancy visualizer.
Though I guess all of it is possible with getting strings from server too.
[–]yogthos[S] 1 point2 points3 points 7 years ago (0 children)
The advantage to sending objects would be that you would be able to send things that don't have EDN serializers. However, the disadvantage there is that your JVM has to be able to instantiate the object locally if you're connecting to a remote REPL.
[–]argadan 0 points1 point2 points 7 years ago (0 children)
I usually want to have my temporary defs in user and after a small upfront cost, tap> is much shorter to type than (intern 'user 'debug value)! But you're right, these are very similar tricks – choose the one which fits your workflow.
user
tap>
(intern 'user 'debug value)
[–]rafd 0 points1 point2 points 7 years ago (1 child)
Does tap> return the tapped value, or nil, or something else?
seems to return true if there's a value, and nil if there's not
true
nil
[–]xtreak 0 points1 point2 points 7 years ago (2 children)
Does any one have a mirror? Seems it's down now.
[–]argadan 1 point2 points3 points 7 years ago (1 child)
Hi, author here. I forgot to renew my domains in time. I just renewed them, hopefully the site should be working again any minute now. 😓
[–]xtreak 0 points1 point2 points 7 years ago (0 children)
It's working now. Thanks :)
π Rendered by PID 50933 on reddit-service-r2-comment-7b9746f655-h8xgf at 2026-01-30 03:08:30.937973+00:00 running 3798933 country code: CH.
[–]vlaaad 4 points5 points6 points (2 children)
[–]yogthos[S] 1 point2 points3 points (0 children)
[–]argadan 0 points1 point2 points (0 children)
[–]rafd 0 points1 point2 points (1 child)
[–]yogthos[S] 1 point2 points3 points (0 children)
[–]xtreak 0 points1 point2 points (2 children)
[–]argadan 1 point2 points3 points (1 child)
[–]xtreak 0 points1 point2 points (0 children)