Anonymous functions in C
github.com
Anonymous functions in C
1–10 of 51 posts
Re: Anonymous functions in C
#2Re: Anonymous functions in C
#3Re: Anonymous functions in C
#4This is basically a way of obfuscating your C code. If you want to write obfuscated code, C++ has extensive support for this. I think it's actually a strength of C to not have many features. It ultimately makes code more readable and reliable.
C++ in fact is only usable (in a team) if its features are pruned and limited in a team. Really
Throw in some fine preprocessor magic and you'll end up with completely unmaintanable and impossible to understand code.
Re: Anonymous functions in C
#5Re: Anonymous functions in C
#6This is basically a way of obfuscating your C code. If you want to write obfuscated code, C++ has extensive support for this. I think it's actually a strength of C to not have many features. It ultimately makes code more readable and reliable.
I don't think I can agree more with your comment. C++ in fact is only usable (in a team) if its features are pruned and limited in a team. Really Throw in some fine preprocessor magic and you'll end up with completely unmaintanable and impossible to understand code.
Re: Anonymous functions in C
#7That's neat, but without closures I don't really see how you could do much with it outside of toy examples. Going off the examples -- how often do you write something like a foreach or a map or reduce that doesn't reference its enclosing scope?
Re: Anonymous functions in C
#8That's neat, but without closures I don't really see how you could do much with it outside of toy examples. Going off the examples -- how often do you write something like a foreach or a map or reduce that doesn't reference its enclosing scope?
Re: Anonymous functions in C
#9Earlier quoted context omitted.
I don't think I can agree more with your comment. C++ in fact is only usable (in a team) if its features are pruned and limited in a team. Really Throw in some fine preprocessor magic and you'll end up with completely unmaintanable and impossible to understand code.
Yeah. C is a boring language that barely ever changes. But I'm not sure there isn't wisdom in being dull.
Assuming you have this:
struct point {
float x, y, z;
};
void do_something_with_point(struct point *p);
You can do this: do_something_with_point(&(struct point){.x = 1.5, .y = 1.5, .z = 3.5});Re: Anonymous functions in C
#10This is basically a way of obfuscating your C code. If you want to write obfuscated code, C++ has extensive support for this. I think it's actually a strength of C to not have many features. It ultimately makes code more readable and reliable.