Hacker News new | past | comments | ask | show | jobs | submit login

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

    Nested functions

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...



Not "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.


Is 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_La...


A later version is available here (along with the compiler itself): https://winworldpc.com/product/metaware-high-c-cpp/33x


I suspect not. I am lucky enough to be consulting this copy: https://mastodonapp.uk/@JdeBP/113199154771277394

(-:


You can still do

    *(foo ? &zork : &bork) = 123;


What a cursed thing. I like it.


    > foo ? zork : bork = 123;
That's kind of horrifying.


GCC’s different implementation is mentioned in the article.


GCC 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.


I actually like GCC's nested functions a lot, although an implementation with function descriptors would be much better.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: