Closed eitsupi closed 3 months ago
Can't be certain what you want to achieve here, but in nanonext
I simply define the methods for [[<-
and $<-
as no-ops for the relevant class.
This avoids these cumbersome operations every time, and still allows modification using assign()
in case you actually want to do that in other parts of your code.
they may be overwritten by accident.
What accident did you experience?
I simply define the methods for
[[<-
and$<-
as no-ops for the relevant class.
Thanks for the idea, this sounds simple.
What accident did you experience?
I haven't had any real trouble, but I imagine that there might be a case where you might want to allow updates via $
in a dataframe-like object, just as the arrow Table built on R6 allows column updates via $
.
In that case I figured something like .ptr
would need to be prevented from being overwritten.
I see, thanks for the details.
Currently, objects generated from Structs and functions generated from methods of that Struct are not locked, so they may be overwritten by accident. I suppose it's okay to lock these in the wrapper file. For example: