Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Do not trace vars if already traced #4

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

dm3 commented Aug 28, 2013

Calling trace-var* several times, untrace-var* removes only the highest level of tracing.
trace-var* should be a noop when called for an already traced var.

Contributor

lprefontaine commented Aug 28, 2013

Hi,

Clojure contrib projects cannot accept pull requests - see http://clojure.org/contributing for a description of the process for contributing to Clojure and its libraries.

Nonetheless, you brought a legitimate concern.

However, should or should not opinions are essentially worthless to reach a good
decision. Other people might find the other way around well suited.

Some use cases are needed to decide which approach is to be declared an
acceptable behavior.

Can you bring some meat on the table ? How do you end up with
multiple calls to trace-vars ? In the REPL ? Through programmatic calls ?

My personal opinion is that when used programmatically, it could be worth
to keep the current behavior. But this comes at the top of my head without
spending too much time thinking about it.

I will add a JIRA ticket with your inputs and get some advices from the developers
about this issue.

Thank you,
Luc

Calling trace-var* several times, untrace-var* removes only the highest level of tracing.
trace-var* should be a noop when called for an already traced var.
You can merge this Pull Request by running:

git pull https://github.com/dm3/tools.trace no-nested-traces

Or you can view, comment on it, or merge it online at:

#4

-- Commit Summary --

  • fix(trace-vars): Do not trace if already traced

-- File Changes --

M .gitignore (1)
M src/main/clojure/clojure/tools/trace.clj (5)
M src/test/clojure/clojure/tools/test_trace.clj (11)

-- Patch Links --

https://github.com/clojure/tools.trace/pull/4.patch
https://github.com/clojure/tools.trace/pull/4.diff

Softaddictslprefontaine@softaddicts.ca sent by ibisMail from my ipad!

dm3 commented Aug 29, 2013

Sorry, I've only realized this library is part of Clojure after I've made the pull request.
It'd be great if you provide a link to the JIRA ticket when it's created.

My use case is instrumenting my code while in REPL. Things like trace-all-ns-like which trace-nses all of the matching namespaces loaded into REPL at the time of call. Calling the function second time after loading some more namespaces makes previous traces double.

You probably might wan't to trace a var several times if you rebind the tracer to some other thing beforehand. This leaves the question of how to untrace such nested traces.

Thanks,
Vadim

Contributor

lprefontaine commented Aug 29, 2013

Ah, this makes it clearer. Will open the ticket and spend some brain power
on it :)

Luc

Sorry, I've only realized this library is part of Clojure after I've made the pull request.
It'd be great if you provide a link to the JIRA ticket when it's created.

My use case is instrumenting my code while in REPL. Things like trace-all-ns-like which trace-nses all of the matching namespaces loaded into REPL at the time of call. Calling the function second time after loading some more namespaces makes previous traces double.

You probably might wan't to trace a var several times if you rebind the tracer to some other thing beforehand. This leaves the question of how to untrace such nested traces.

Thanks,
Vadim


Reply to this email directly or view it on GitHub:
#4 (comment)

Softaddictslprefontaine@softaddicts.ca sent by ibisMail from my ipad!

Contributor

lprefontaine commented Aug 29, 2013

ttrace-3

Thank you
Luc P.

Sorry, I've only realized this library is part of Clojure after I've made the pull request.
It'd be great if you provide a link to the JIRA ticket when it's created.

My use case is instrumenting my code while in REPL. Things like trace-all-ns-like which trace-nses all of the matching namespaces loaded into REPL at the time of call. Calling the function second time after loading some more namespaces makes previous traces double.

You probably might wan't to trace a var several times if you rebind the tracer to some other thing beforehand. This leaves the question of how to untrace such nested traces.

Thanks,
Vadim


Reply to this email directly or view it on GitHub:
#4 (comment)

Softaddictslprefontaine@softaddicts.ca sent by ibisMail from my ipad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment