Skip to content
Prev 389184 / 398506 Next

Evaluating lazily 'f<-' ?

names(x) <- c("some names")

if different from

`names<-`(x, value = c("some names"))

because the second piece of code does not ever call `<-`. The first piece
of code is (approximately) equivalent to

`*tmp*` <- x
`*tmp*` <- `names<-`(`*tmp*`, value = c("some names"))
x <- `*tmp*`

Another example,

y <- `names<-`(x, value = c("some names"))

now y will be equivalent to x if we did

names(x) <- c("some names")

except that the first will not update x, it will still have its old names.
On Mon, Sep 13, 2021 at 4:33 PM Leonard Mada <leo.mada at syonic.eu> wrote: