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
Marker for magrittr call frames #141
Comments
|
Would you have a look at the "update" branch to see how it could be implemented in that one? It is a simpler function being "compiled" for the pipeline and will be the way going forward. I have just been too busy to finalize it. |
|
Just tried the branch, the same problem occurs and the same solution would fix it. Nice stacktrace by the way. Too bad we can't access the value of |
|
I can send a PR to install the marker if you'd like. A simple |
|
Sure - better do it to the update branch. That really should be master. |
|
@lionel-: Any updates here? Looks like the currently skipped "filter understands .env in a pipe" tests are related to this problem. |
|
I have a PR ready but haven't sent it because it's possible we are going to play down the |
|
Given that we're only using |
lionel- commentedMar 1, 2017
We are currently porting the tidyverse to the tidy evaluation framework and one aspect of this is to establish pronouns in DSLs so users can be explicit about scoping. E.g. dplyr will have a
.datapronoun for the input data frame and a.envpronoun for the calling context..envcurrently gives surprising results with magrittr. E.g. if you havefoodefined in the current context,.env$foodoesn't work because.envis actually a child of the calling environment (so it can install the magrittr pronoun.).The only clean way I can see to solve this is to have magrittr add an attribute or some kind of marker to its frame environment. This marker should resolve to the real calling environment so we don't have to worry about future changes in magrittr internals (i.e. magrittr frames can become a grandchild of the calling env if they ever need to). It's still a bit annoying because we require specific support for magrittr in all functions that need the real
parent.frame(), but at least this would provide a robust solution.cc @hadley
The text was updated successfully, but these errors were encountered: