how to get a primitive function object
Yi Zhang wrote:
# now what?? &%#*
now you are really motivated to use '=' instead of '<-':
x = 3
x
# 3
vQ
Thanks. That certainly is an option. But I want to preserve `<-`'s functionality because I'm writing a package and I don't want to limit the package user's freedom to use `<-`...
i was sort-of joking, though it's a real option if you want it.
but seriously, there's no reason for the &%#* lamenting:
x <- 1
'<-' = function(x,y) 0
x <- 2
# 0
.Primitive('<-')(x,2)
x
# 2
base::'<-'(x, 3)
x
# 3
base::'<-'('<-', base::'<-')
x <- 4
x
# 4
vQ