Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:The preprocessor is a separate, strictly line-oriented language. Arguably with better syntax than C itself:On 14/12/2024 22:22, Keith Thompson wrote:Declarations can be bundled. Function definitions cannot.bart <bc@freeuk.com> writes:>On 14/12/2024 20:17, Waldek Hebisch wrote:[...]Bart <bc@freeuk.com> wrote:For the same reason that f(1 2 3) might be unambiguous, as usuallyThose are function *definitions*. Declarations, including function
it's written f(1, 2, 3).
>
Actually, since C likes to declare/define lists of things where other
languages don't allow them, such as:
>
typedef int T, U, *V;
>
struct tag {int x;} a, b, c;
>
enum {red, green} blue, yellow;
>
I couldn't quite see why you can't do the same with functions:
>
int F(void){return 1;}, G(void){return 2;}
declarations, can be bundled :
int F(void), G(void); // not suggesting this is good style
Definitions that are not declarations, such as function definitions,
cannot.
I thought you liked consistency.
Consistency would mean function definitions could be 'bundled' too.
More generally, some things can be bundled, and other things cannot.
The existing rules are consistent.
What else do you think should be able to be bundled? Macro definitions?
Include directives?
#include <stdio.h>, <stddef.h>; // ???
C is not 100% consistent and orthogonal. It was never intended to be.I was idly speculating in my reply to WH. There was no need to get involved.
Every here knows that it isn't. If you want Lisp, whose syntax rules
are simpler than C's, you know where to find it.
Google "foolish consistency".
[...]If the language allowed function definitions to be bundledI don't care about it.Excellent. Then let's drop it.
Les messages affichés proviennent d'usenet.