-
Notifications
You must be signed in to change notification settings - Fork 181
[Fix cider#1089] Don't instrument symbol in call position #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Defines a new function instrument-function-call, which is like instrument-coll, except the first element is not instrumented. This is only used if the first element is a symbol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function call == Java method call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, function call means a sexp that starts with a symbol which is not a macro nor a special form.
So it includes java methods, but also includes any regular function call.
I'll clarify that in the docstring. Would you prefer a different function name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a new name.
|
The tests are failing with
Is that an issue with travis? |
Maybe. Btw, looking at the issue this is supposed to fix I'm kind of confused. How exactly is this change related to dealing with static Java methods? |
Static java methods (AFAIK) are either called as functions (as in The symbol on a call position (AFAIK) is either:
So, with that in mind, I think only in the 4th case (which is probably the least common) would it be interesting to |
I've cleared the relevant caches, will you try force pushing to restart the build? I can't seem to restart it from the web UI for some reason. |
|
@Malabarba Sounds reasonable. So what happens when an expressions like this is encountered in instrumented code? Do we just step over it or something? I'm asking because normally I instrument only definitions directly and I guess this code instruments the portions of the definition. Being able to step inside a function call in a definition is definitely useful. P.S. I never got to reading the code for the debugger in greater detail, so forgive me if I'm asking something stupid. |
This PR doesn't instrument the first symbol but does instrument the arguments. So, for instance, Is essentially instrumented as (with some stuff omited)
Yes, this PR will still step inside the function call if it has arguments. It will keep doing what was done before, with the exception that it steps over the function name. The current code wraps a
Not at all. The more people who understand what's going on there, the better. |
|
Expanded the docstring and force-pushed. |
[Fix cider#1089] Don't instrument symbol in call position
|
Got it! Thanks! |
Defines a new function instrument-function-call, which is like instrument-coll, except the first element is not instrumented.
This is only used if the first element is a symbol.