4 ms·
That's a fair point but on the other hand I think operator overloading is a must to be able to program math formulas in a language. Do you plan to have somethin
by S4M 10y ago
That's a fair point but on the other hand I think operator overloading is a must to be able to program math formulas in a language. Do you plan to have something like `const` as well? If so, how about allowing operators, but only if they don't modify the object (though, that rules out stuff like+=).
- jesserayadkins2 10y agoConst is something that I'd like to think over before adding it. A question I have is what happens if a List is const, or should it just be that only primitives are const? I could see const values being optimized as just literals down under the hood, which would be nice for performance. I'd have to have a long, long think before adding operator overloading. It's got uses for math, but thus far I've been reluctant to add features that can be abused or used improperly like native class dtors or finally.
- marktangotango 10y agoHave you looked into the difference between c++ const and java final for an example of different semantics? Suffice it to say the two are very different. Not sure why anyone would be doing math code in an interpreted language, I guess if it where embedded in game engine that would be desirable, but then users may wrap c/c++ math libraries with swig-alike to use, using the ffi, whatever that turns out to be.