News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by Etherlord87 on Tuesday July 11, 2023 @03:48PM (#36686356)
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…

Re:C++23: The Next C++ Standard by JohnFen on Tuesday July 11, 2023 @04:40PM (#36686918)
> 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.

Re:C++23: The Next C++ Standard by gpderetta on Tuesday July 11, 2023 @05:51PM (#36687735)
It could annotate the view without changing the source.

For example my editor annotates auto with inferred types and function parameters with parameter names.

Re:C++23: The Next C++ Standard by Etherlord87 on Wednesday July 12, 2023 @05:06AM (#36692033)
The 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.