Skip to content
Prev 167899 / 398502 Next

how to get a primitive function object

I'm still not sure if this can help solve my problem. If I want to
overwrite the `<-` operator for a particular type of objects, but
preserve its effect for other regular objects (in other words, if I do
x<-5 with my new <-, x will be 5 and nothing strange happens), then
what should I put in the [ ] below?
old <- `<-`
old(`<-`, function(x, value){
  if (value is my type) do something
  [ ] # to bind the object value to symbol x: no matter what you do
here, the binding/assignment is local within this function?!
})

Hope I have made myself clear. Thanks,