Skip to content
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

Native Pipe Backport #69

Closed
selkamand opened this issue Oct 21, 2022 · 2 comments
Closed

Native Pipe Backport #69

selkamand opened this issue Oct 21, 2022 · 2 comments

Comments

@selkamand
Copy link

Hi,

Thanks so much for your work on this package. Its a really great idea!

Don't know if its possible, but I'd love to use the native pipe |> (introduced in R 4.1) in my packages without forcing everyone on less recent version to update.

Is this possible / in scope for backports

If not, do you have any ideas for alternative solutions?

@dmurdoch
Copy link
Contributor

I am pretty sure that's not possible, because |> is not legal syntax in the earlier versions. I don't know any good workaround, but it might be possible to maintain two sets of sources for your functions: one that works in R 4.1, and one that works in earlier versions, which can be produced automatically by deparsing your code (since x |> f() deparses to f(x)). It would need a lot of care to get it right and keep it right, and probably isn't worth doing.

The alternative, much easier, way to support pre-4.1 R is to use magrittr pipes instead. Or just skip pipes in your source code.

@mllg
Copy link
Member

mllg commented Mar 10, 2023

I also don't see a way to backport changes in the parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants