3 ms·
what is it with fn()? If we are so much into being terse then int abc() should be just fine. If we need readability than function() instead of fn() would do bet
by FpUser 4y ago
what is it with fn()? If we are so much into being terse then int abc() should be just fine. If we need readability than function() instead of fn() would do better.
- azinman2 4y agoFrom the post: - Although C3 mostly conforms to C syntax, the most obvious change is requiring `fn` in front of the functions. This is to simplify searching for definitions in editors.
- lyrachord 4y ago
- stormbrew 4y agoIf you haven't heard of it before, look up the "most vexing parse" for the kind of thing languages are trying to avoid with this syntactic approach. That specific one is a c++ thing, but C also has its own versions of it (that c++ inherits). Basically the C grammar is only context free if you cheat in the lexer, and any language trying to improve on C is likely to try to avoid that (or just give up and go wild).
- lelanthran 4y agoI interpreted the GP to mean: "Why use `fn` instead of `function`?" After all, he did say: > If we need readability than function() instead of fn() would do better.
- stormbrew 4y agoRight, I'm saying that it's not about human readability, it's about parser (and I suppose grep) readability. So the goal is to make the parse easier with as little effort on the part of the programmer as possible. The whole word function would take up an unnecessarily large part of a line for that purpose.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- yellowapple 4y agofn() strikes me as a reasonable compromise between those two concerns.
- deleted 4y ago[deleted]
- throwawaymaths 4y agoint abc() is not context-free Iirc.