3 ms·
Would allowing spaces in identifiers even introduce any ambiguity in most languages? I think the only languages I've seen where it would matter are functional l
by throwaway482945 2y ago
Would allowing spaces in identifiers even introduce any ambiguity in most languages? I think the only languages I've seen where it would matter are functional languages. e.g. I think it'd be possible to write a Python program using spaces instead of underscores, and be able to unambiguously parse it with a slightly modified parser?
- ReleaseCandidat 2y ago> I think the only languages I've seen where it would matter are functional languages. Yes, ML style function application is a problem and treating newlines as "normal" whitespace without having line separators (aka semicolons). And keywords used as infix operators, like another post reminded me of.
- lpribis 2y agoThe classic example of why whitespace in identifiers arguably causes more problems than it solves is https://www-users.york.ac.uk/~ss44/cyc/p/fbug.htm https://www-users.york.ac.uk/~ss44/cyc/p/fbug.htm. Since the space of valid syntax becomes so much larger, typos are more likely to result in valid but incorrect programs. Especially in dynamic interpreted languages like python.