Allowed Vector Subsets during assignment
- Dominant language
- Rust
- Stars
- 145
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
This is just a copy of this comment https://github.com/dgkf/R/pull/112#issuecomment-2054041873 as I don't want it to get lost in case the PR gets merged.
R has some edge-cases where subset-assignment has weird (and I image undefined) behavior:
```r
> x[c(1, 1)][c(1, 2)] <- c(99, 100)
> x
[1] 100 2 3 4 5 6 7 8 9 10
```
I think we should only allow vector subsets in assignment calls where the behavior is well-defined.
From the currently supported subsets, I think `Subset::Mask` and `Subset::Range` have this property, i.e. they can never produce a view where the same data is referenced via different indices of the resulting view.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.