I’m 100% sure there’s some ugly way to make it work in C, but I’m also 100% sure it shouldn’t be done.
If it’s that big of a deal, just use a language that has it built in. No doubt the compiler for that language will have a better implementation than hacking your own into C.
So all he wants is to be able to replace
void f(void) { g(x,y,z); }
with something that allows him to avoid the definition of f? Really?
Also “partial function” to mean “curried function” is confusing as hell.
It’s confusing only if you conflate “curried function” with “partial(ly applied) function”; remember that currying a function converts (A, B, …) -> Z to A -> B -> … -> Z. See https://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application
Of course, in mathematics “partial function” means “not defined on all elements of the domain”.
I’m 100% sure there’s some ugly way to make it work in C, but I’m also 100% sure it shouldn’t be done.
If it’s that big of a deal, just use a language that has it built in. No doubt the compiler for that language will have a better implementation than hacking your own into C.