3 ms·
Has any other mainstream programming language like C or Java introduced such reserved keywords in a new release? I guess if C or Java were to do something like
by foo101 8y ago
Has any other mainstream programming language like C or Java introduced such reserved keywords in a new release? I guess if C or Java were to do something like this it would cause a lot of hue and cry.
I remember when C++ had to introduce a keyword for automatic type inference they reused the 'auto' keyword instead of introducing a new keyword at the risk of breaking a lot of existing code.
How do other mainstream languages handle a scenario like this where a new keyword is required?
- floatboth 8y agoC/C++ compilers support multiple versions of the standards at the same time. You can compile one file with -std=c++98 and another with -std=c++17 and link them together just fine. Rust is now doing the same thing with editions. Perl has 'use VERSION', but I'm not very familiar with it, not sure if e.g. new keywords only become available with that statement. The docs say 'use VERSION also lexically enables all features available in the requested version…'
- pas 8y agoenum, assert was added to Java, but nothing major since then. (var is an invalid class name starting in Java 10, and underscore is a keyword since Java 9) https://en.wikipedia.org/wiki/List_of_Java_keywords https://en.wikipedia.org/wiki/List_of_Java_keywords For C++ ( New keywords: alignas, alignof, char16_t, char32_t, constexpr, decltype, noexcept, nullptr, static_assert, and thread_local ) : https://stackoverflow.com/questions/6399615/what-breaking-changes-are-introduced-in-c11 https://stackoverflow.com/questions/6399615/what-breaking-ch...