-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Allow assignment of size 1 with Subsetter #349
Conversation
Florian, can we please try it the other way around as previously discussed:
This one once again start from the wrong (though I agree that it is of course a very small one...). |
We briefly discussed this issue here #345 but I will create a new one |
We can keep this open, it looks like a valid patch. I just do not like "random" pull requests that fly in without prior discussion. In this case, if #345 is/was indeed the place where this was discussed, then the fault is on me for not remembering -- and you for not referencing it. I have to deal with more than one discussion at a time, so helpful pointers are appreciated. In any event, documentation, tests, changelog entries etc pp are also clearly missing from the PR. So please reopen and augment as you see fit. |
84f4508
to
28bbd09
Compare
Could you have a look to my last commits? |
The patch is fine as far as it mechanics go. But I can't make up my mind on this:
Recycling has very specific meaning in R. We have avoided it here, mostly, as it is not natural for C++. I am not yet convinced this really helps. @kevinushey @jjallaire Any thoughts? |
Looks good to me! The PR fixes a bug in the old implementation (the goal was to allow recycling in the first place; it just was not implemented correctly) |
Thanks for that. |
Ok, with this and the parallel email discussion this is good to go. |
Allow assignment of size 1 with Subsetter
R allows singleton vectors to be assigned to vectors subsets with more than one element.
Here is an example:
This feature is currently not available in Rcpp as previously discussed in #345
Code:
Result:
This PR fixes this issue by returning the same result as R: