Hacker News new | ask | show | jobs
by musicale 496 days ago
I just wish they hadn't repurposed the old "auto" keyword from C and had used a new keyword like "var" or "let".

   #define var auto
   #define let auto
2 comments

If we're going that route, how about

   #define var auto
   #define let const auto

?
I was thinking of having one or the other, but let as the const form is appealing. ;-)
Given how important backwards compatibility is for C++, it's either take over a basically unused keyword or come up with something so weird that would never appear in existing code.

Java solved this by making var a reserved type, not a keyword, but I don't know if that's feasible for C++.