4 ms·
So ... GCC has had some of these for ages. Pascal lets you match a range of values with case low..high; wouldn't it be great if C had that feature? High C
by amszmidt 2y ago
So ... GCC has had some of these for ages.
Pascal lets you match a range of values with case low..high; wouldn't it be great if C had that feature? High C does, another feature standard C and C++ never adopted.
https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
Nested functions
https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
Generators
GCC doesn't do those --- looks like a fun feature though!
My favourite, which was sadly removed was doing:
foo ? zork : bork = 123;
Oh well...
- JdeBP 2y agoNot "ages" in comparison to how long MetaWare had them. High C had this stuff back in the early 1990s and 1980s. The headlined article doesn't mention it, but High C/C++ had modules all of those years ago, too. Anybase literals, as well. Tom Pennello participated in the standardization efforts back then, too, but none of this stuff made it in.
- mananaysiempre 2y agoIs the manual online anywhere? The one for version 1.2 on Bitsavers[1] doesn’t mention any of those. [1] https://bitsavers.computerhistory.org/pdf/metaware/High_C_Language_Reference_Manual_1.2_Nov85.pdf https://bitsavers.computerhistory.org/pdf/metaware/High_C_La...
- JdeBP 2y agoI suspect not. I am lucky enough to be consulting this copy: https://mastodonapp.uk/@JdeBP/113199154771277394 https://mastodonapp.uk/@JdeBP/113199154771277394 (-:
- mezentius 2y agoA later version is available here (along with the compiler itself): https://winworldpc.com/product/metaware-high-c-cpp/33x https://winworldpc.com/product/metaware-high-c-cpp/33x
- pistoleer 2y agoYou can still do *(foo ? &zork : &bork) = 123;
- rescbr 2y agoWhat a cursed thing. I like it.
- adastra22 2y agoGCC’s different implementation is mentioned in the article.
- qalmakka 2y agoGCC nested functions are atrocious and deserve being banned from existence. Like the article rightfully says they've been implemented using weird hacks that make basically impossible to use them safely. There's a reason why Clang has categorically refused to implement them.
- deleted 2y ago[deleted]
- uecker 2y agoI actually like GCC's nested functions a lot, although an implementation with function descriptors would be much better.
- deleted 2y ago[deleted]
- ronsor 2y ago> foo ? zork : bork = 123; That's kind of horrifying.