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

Consistent dots-splicing #576

Closed
egnha opened this issue Nov 21, 2018 · 3 comments
Closed

Consistent dots-splicing #576

egnha opened this issue Nov 21, 2018 · 3 comments

Comments

@egnha
Copy link
Contributor

egnha commented Nov 21, 2018

Some functions support dots-splicing, e.g.,

compose(log, abs)
compose(!!!list(log, abs))

while others do not, e.g.,

map(letters, paste, 1:3, sep = "_")
map(letters, paste, !!!list(1:3, sep = "_"))  # error

Should dots-splicing behavior be more consistent across purrr?

(I presume this might already be under consideration for tidyverse packages, generally. Just flagging it for the record ... )

@lionel-
Copy link
Member

lionel- commented Nov 21, 2018

I've just started looking into this 2 minutes ago ;)

@lionel-
Copy link
Member

lionel- commented Nov 21, 2018

This is not as trivial as I thought because as_mapper() also takes the dots, and we need to be careful to evaluate spliced arguments only once. So for now we'll just have to rely on the mapped function to support tidy dots.

@lionel- lionel- closed this as completed Nov 21, 2018
@egnha
Copy link
Contributor Author

egnha commented Nov 21, 2018

That was my feeling as well. One workaround for effectively making map_*() comprehend dots-splicing would be for partial() to comprehend dots-splicing (cf. #457). But I'm not sure whether that'd be a practical alternative (how many users would think to do that?), not to mention the added verbosity.

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

2 participants