3 ms·
I don't understand your first example. They are both correct, but have different semantic meaning. A parser doesn't have to try to find incorrectness there, it
by davidgrenier 4y ago
I don't understand your first example. They are both correct, but have different semantic meaning. A parser doesn't have to try to find incorrectness there, it simply has to infer the semantic meaning of both, which is... the second one calls function3() irrespective of x. Both programs should be expressible in any language hence I don't see why you are placing the onus on the compiler to tell you one is incorrect.
- dmitriid 4y ago> They are both correct, but have different semantic meaning. Exactly > it simply has to infer the semantic meaning of both, which is How exactly do you want the parser for the formatter to "infer semantic meaning"? It has no knowledge of the human requirements for this code. To the parser both are valid > Both programs should be expressible in any language hence I don't see why you are placing the onus on the compiler to tell you one is incorrect. Are we talking about "expressible in any language"? No. Here's what I wrote: "Formatters will no save you from the many, many, many cases where indentation is simply ambiguous" in the context of formatters.