-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
R allows for Replacement functions (http://adv-r.had.co.nz/Functions.html#replacement-functions, or https://cran.r-project.org/doc/manuals/R-lang.html#Subset-assignment) like levels(var)<-c(...). We can extend the syntax to allow for such attribute assignment. According to https://cran.r-project.org/doc/manuals/R-lang.html#Subset-assignment,
names(x) <- c("a","b")
is equivalent to
`*tmp*` <- x
x <- "names<-"(`*tmp*`, value=c("a","b"))
rm(`*tmp*`)
The proposal is something like ``%@%(x, key, value), or `x%@%key <- value`.
x@key <- val
[update: yes!] should be interpreted as
`@`(x, key) <- val
`@<-`(x, key, value=val)
[update: no!] or if evaluation starts from <- first.
`x@key<-` () <- val
which won't make any sense.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels