logoalt Hacker News

Y_Ylast Monday at 3:11 AM1 replyview on HN

Without curring and closures it certainly will be more painful!

I might write the equivalent signature,

  D f(A, B, C)
and then reorganize things to just pass f around, or make a struct if you really want to bake in your first function.

Replies

Tweylast Monday at 11:54 AM

Right, due to the complexity of the syntax one of the most sensible things to do in C if you're faced with a problem that maps naturally to higher-order functions is to reframe the problem so that the solution doesn't use higher-order functions — basically doing a compilation step yourself. D (*f(B (*)(A)))(C) is definitely a fancy type, after all :)