-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rigging more than one function #16
Comments
I don't understand what The use case here is package development ? I think for |
Yes.
I wouldn't couple this too tightly with |
How about |
Thanks, I'll take a look at {debug me}, sounds interesting |
If we modify functions in their namespace :
If we use devtools, I believe we can simply place rigged copies in an environment attached on the search path right next to
The rigged function's body's functions should be evaluated first in
Rigging namespaced functions would be harder, e.g. if i want to To support it we might :
It's still not quite enough because if I've attached dplyr or do it later, |
This starts getting very complicated. The current implementation works great. I suspect shims might get us into other kinds of trouble down the line. I remember this painfully from mockr. Also, I don't care too much about unrigging. I see two components of the problem:
The first can be achieved with a simple extension of For the second problem, {debugme} can provide inspiration. |
@krlmlr I've implemented I've played around a bit and it seems to work fine, it's a bit hard to follow the log though, maybe the rigged function should announce itself : we'd print in a different color "going through Another option is to change colors each time we enter a different rigged function, 3 cycling colors would be enough for us to know if we're going forward or back in the stack. unexported functions when not using devtools::load_all() (which basically exports them), is not well supported yet. I'd like a new I think |
To unrig, can we store the old function code?
|
The code doesn't change, the environment does, and we'd need to store it indeed |
Most functions use the package environment, but I agree it's safer to cache it for the general case. |
Currently, it seems difficult to create a reprex with |
This seems to work :
I will add |
done in 9010b21 In the above I exported both functions, it's not a limitation of |
Could |
The main feature is there, splitting the rest into new issues for V 0.2 |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
that call each other.
#11 (comment)
I'd like to propose a
wire()
function:And also
ignite()
, to be called from.onLoad()
:To be used like this:
The text was updated successfully, but these errors were encountered: