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

What's the difference, between a function with multiple entry points, and several very similar functions? Sharing of instructions for a more compact image? That could be a compiler optimization.

A work around would be to put most of the body into a macro which is expanded into multiple functions that have alternative entry means.

C returns multiple values via structs; e.g. see the standard library functions div and ldiv.

Coroutines can be hacked in C. I've hacked delimited continuations in C; they work by copying sections of the stack out to a heap-allocated object, which is restored to the current stack top when the continuation is resumed.

Hacking coroutines in C was a popular sport in the 1980's and 90's.

Exception handling can be implemented in C. I wrote a library for that a quarter century ago; it is used in Wireshark. More recently I created a Lisp language which has exception handling; it's rooted in the C one.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: