On Saturday, March 2, 2019 at 1:23:21 PM UTC-6, Glen Mailer wrote: > > Hello All > > I was wondering if there is an annoucement or a rationale doc coming for > (tap>) and it's related functions? The current docstrings do a good job of > telling you what they do and how to use them, but the docs on the homepage > <https://clojure.org/reference/repl_and_main#_tap> seem quite open-ended. > Was there a particular motivating case which led to their inclusion in core? >
tap is primarily intended for pr-style debugging. When you need that kind of debugging, you don't want to include an additional library or muck with your requires, so tap> is in core. > > I've been playing around with them a bit, a colleague of mine was using > them for local debugging, but then we were unsure whether it made sense to > leave them committed when the code shipped to production. I've also been > experimenting with extending our logging protocol to send all of the > application logs to tap, where they can be siphoned off elsewhere. > I don't think you should send stuff to tap> willy-nilly, but might make sense to have that as an option. > One thing I did find a bit unusual was that although these are somewhat > similar to `add-watch` and `remove-watch`, there is no `reference` > argument, so if a function is re-evaled then it can be easy to lose the > original and be unable to `remove-tap` without reaching into the private > set. Is there a reason for this omission? I'm fairly confident that a > backwards-compatible extension to take an optional reference could be added > if not, defaulting to the fn itself. Failing that, a `clear-taps` fn might > be desirable. > Again, in a debug mode, you're generally dynamically adding and removing a tap function dynamically so it's not really an issue. That said, feel free to file an issue on the problem here (losing the function reference via re-eval). > > Thanks > Glen > > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.