c3lang / c3docs-old

Docs for the C3 language
http://www.c3-lang.org
10 stars 15 forks source link

'fn' for defining function types, not for function declaration. #45

Open soldate opened 6 months ago

soldate commented 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

lerno commented 6 months ago

Here are my current thoughts on the subject: https://c3.handmade.network/blog/p/8886-why_does_c3_use_%2527fn%2527#30031