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

How to treat vector-assignment to list #186

Open
sebffischer opened this issue Oct 5, 2024 · 0 comments
Open

How to treat vector-assignment to list #186

sebffischer opened this issue Oct 5, 2024 · 0 comments
Labels
status-feedback-needed Needs further discussion before moving further theme-base Function implementations

Comments

@sebffischer
Copy link
Collaborator

In R, assigining a vector to a list-slice vectorizes:

 l = list(1, 2, 3); l[1:2] = 10:11; l
#> [[1]]
#> [1] 10
#> 
#> [[2]]
#> [1] 11
#> 
#> [[3]]
#> [1] 3

Created on 2024-10-05 with reprex v2.1.1

I am not sure whether I think this is the desireable behavior. Maybe this should instead recycle the 10:11 into a list(10:11, 10:11) and then perform the assignment. This would then result in a list(10:11, 10:11, 3) instead of list(10, 11, 3) as above.

@sebffischer sebffischer added theme-base Function implementations status-feedback-needed Needs further discussion before moving further labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-feedback-needed Needs further discussion before moving further theme-base Function implementations
Projects
None yet
Development

No branches or pull requests

1 participant