Created
November 27, 2011 18:39
-
-
Save nvartolomei/1397951 to your computer and use it in GitHub Desktop.
Functional C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define lambda(return_type, function_body) \ | |
({ \ | |
return_type __fn__ function_body \ | |
__fn__; \ | |
}) | |
// Use like this: | |
int (*max)(int, int) = lambda (int, (int x, int y) { return x > y ? x : y; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment