Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

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

Open
soldate opened this issue May 16, 2024 · 1 comment
Open

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

soldate opened this issue May 16, 2024 · 1 comment

Comments

@soldate
Copy link

soldate commented May 16, 2024

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
Copy link
Collaborator

lerno commented May 16, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants