Open soldate opened 6 months ago
Hi, i realy like the c3 approach of being a better c.
But 'fn' in front of function declarations IS A superfluous and an arbitrary deviation from C.
However 'fn' for defining function types and lambdas ARE GREAT.
// === GREAT FN ===
def Foo = fn int();
Foo lambda = fn int() { return 1; };
Foo lambda_short = fn () => 1;
// == NOT OK, TERRIBLE FN ==
fn void my_function(int a) { return a * a; }
Please remove the terrible one from c3! :-D
Here are my current thoughts on the subject: https://c3.handmade.network/blog/p/8886-why_does_c3_use_%2527fn%2527#30031
Hi, i realy like the c3 approach of being a better c.
But 'fn' in front of function declarations IS A superfluous and an arbitrary deviation from C.
However 'fn' for defining function types and lambdas ARE GREAT.
// === GREAT FN ===
def Foo = fn int();
Foo lambda = fn int() { return 1; };
Foo lambda_short = fn () => 1;
// == NOT OK, TERRIBLE FN ==
fn void my_function(int a) { return a * a; }
Please remove the terrible one from c3! :-D