4 ms·
What if you could type the asterisk to multiply vectors, but then your editor of choice would replace it with the symbol that actually means vector multiplicati
by Etherlord87 3y ago
What if you could type the asterisk to multiply vectors, but then your editor of choice would replace it with the symbol that actually means vector multiplication?
Perhaps that idea falls apart once you realize you would need hundreds of symbols for just addition…
But what if those symbols were (automatically) imported and named at the beginning?
Perhaps it would be annoyingly inconsistent how in various files different symbols are used for the same operation…
- JohnFen 3y ago> then your editor of choice would replace it I realize this is a minority opinion, but I don't want my editor to replace anything unless I've deliberately told it to.
- gpderetta 3y agoIt could annotate the view without changing the source. For example my editor annotates auto with inferred types and function parameters with parameter names.
- Etherlord87 3y agoThe idea is, operator overloading is a convenience feature. Why not have that convenience as an option in an editor, without influencing the language? If you want scalar multiplication to look the same as vector multiplication, set it in your editor. If you want to insert scalar multiplication with the same key you insert vector multiplication, set it in the editor (to figure out which you mean, based on context, when you press that key). Just to be clear, I'm not being a smartass, just considering this as an option and wondering if the HN crowd has some thoughts on this.