On Fri, 2011-10-28 at 17:59 -0700, Muhammad Waliji wrote: > On Fri, Oct 28, 2011 at 5:57 PM, Matthew Dowle > <[email protected]> wrote: > On Fri, 2011-10-28 at 17:42 -0700, Muhammad Waliji wrote: > > On Fri, Oct 28, 2011 at 5:32 PM, Matthew Dowle > > <[email protected]> wrote: > > > > On Fri, 2011-10-28 at 09:52 -0700, Muhammad Waliji > wrote: > > > >From the user's perspective, DT2 <- DT should > either be a > > new copy or > > > a new reference. Anything in between is > confusing. > > > > > > Agreed. With picky caveat: even in base it's not at > this point > > the copy > > is taken. It's later: copy-on-write. It's setkey > and := that > > don't copy > > on write, not the (earlier) <-. > > > > > > Hmm, I would prefer for these to have the same behavior. > > > Not sure I follow, please expand. > > > I would like for DT[, x := foo] and DT$x <- foo to have the same > behavior. i.e. if one preserves the reference, so should the other. >
Agreed, I would too (at least I did to start with). However, it seems a base R thing that <- copies via `*tmp*` and isn't possible to make it work by reference. See the (long) thread on r-devel here : http://r.789695.n4.nabble.com/speeding-up-perception-tp3640920p3640920.html I'm pretty happy with :=, honestly. It's nice that <-, <<- and := all do different and useful things within j. Changes to the meaning of [<- might not have been backwards compatible, so := provides without forcing. Matthew _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
