-
Notifications
You must be signed in to change notification settings - Fork 65
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
Refine +
method
#309
Refine +
method
#309
Conversation
Co-authored-by: Hadley Wickham <[email protected]>
What do you think the correct behaviour is for With CRAN glue (v1.6.2), it's treated like str(glue::as_glue("hello") + NULL)
#> 'glue' chr(0) With anything after 740ca7f, it's an error: as_glue("hello") + NULL
#> Error in `+.glue`(as_glue("hello"), NULL): RHS must be a character vector. The tidyverse recycling rules and #246 don't obviously speak to what to do in the In arithmetic, it is like adding something of the correct type but of length zero: 1.5 + NULL
#> numeric(0) |
I decided to make |
I'm not sure that's right; I would have expected it to return |
I merged #297, but then I got to thinking more about recycling. That PR actually changed some behaviour around length-0 input (#286 (comment)).
I think we'll be happier in the long-run to route
+
throughglue_data()
rather thanpaste0()
to keep recycling behaviour more in sync. I might add a couple of tests to this PR re:+
and input lengths.