data.table has introduced the := operator. Why not overload <-?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think there is any technical reason this should be necessary, for the following reason:
:=is only used inside[...]so it is always quoted.[...]goes through the expression tree to see if:=is in it.That means it’s not really acting as an operator and it’s not really overloaded; so they could have picked pretty much any operator they wanted. I guess maybe it looked better? Or less confusing because it’s clearly not
<-?(Note that if
:=were used outside of[...]it could not be<-, because you can’t actually overload<-.<-Doesn’t evaluate its lefthand argument so it doesn’t know what the type is).