4 ms·
I think you are missing the point. Of course you can't assume what a function will do with certainty.
by jy3 10y ago
I think you are missing the point. Of course you can't assume what a function will do with certainty.
- pjmlp 10y agoFrom CS point of view + is just a function name just like any other. A concept used in lambda calculus, introduced in computing since Lisp exists. Also part of abstract mathematics field, where operator symbols get defined for the proofs.
- sagichmal 10y ago> From CS point of view + is just a function name just like any other. From a Go point of view, it isn't.
- pjmlp 10y agoJust because Go eschews decades of CS knowledge, in the name of the "easy to hire programmers" for Google[1], it doesn't make it less true. [1] - According to the language designers own words
- sheepmullet 10y agoThe point is in most languages operator overloading is no more complex than a method call. It's not exactly magic.
- nuggien 10y agoOverloading + could be magic if you want it to be. In go, + is exactly what you think it is. In languages with operator overloading, I literally could make + do whatever I wanted to.
- pjmlp 10y agoJust like you can make a function do something totally unrelated to how it is called, do what it is actually in the name, wipe out the hard drive, launch missiles, whatever.