3 ms·
Whitespace in this context is used as a token separator. Where you place the space is of course important. --i is very different than - -i but the same as -
by halayli 3y ago
Whitespace in this context is used as a token separator. Where you place the space is of course important. --i is very different than - -i but the same as - -i.
When people say "whitespace matters", what it means is whether the meaning changes when you have more than 1 not more than 0.
- klyrs 3y agoYeah, this rage-inducing headline is completely unwarranted.
- aidenn0 3y agoYeah, by TFA's definition whitespace matters in K&R C because of things like: inta; vs int a; To which I can just say "duh!"
- seanhunter 3y agoRight, or various pathological examples involving comment delimiters being mistaken for divde and multiply operators
- GrumpySloth 3y agoIt’s not a token separator in the "#define foo(x)" example. You never get a "foo(" token, regardless of whitespace, but whitespace decides whether it’s a function macro definition or a constant definition. The standard needed to invent a new token called lparen, which is a left round bracket that is not preceded by whitespace, to make it make any sense.
- aidenn0 3y agoOh yeah, the C preprocessor is extremely mediocre, even compared to other text-based macro preprocessors
- foofie 3y ago> When people say "whitespace matters", what it means is whether the meaning changes when you have more than 1 not more than 0. I agree. After reading the blog post, it's clear that the author should have called it "syntax errors do matter in C23"