3 ms·
Well, thinking about it more, I did realize there's a pretty nasty edge case with my hypothetical JavaScript syntax: let let x = 5; let x = 6; // should
by m48 8y ago
Well, thinking about it more, I did realize there's a pretty nasty edge case with my hypothetical JavaScript syntax:
let let x = 5;
let x = 6;
// should this set the variable "let x"?
// or define a variable named "x"?
One could potentially design around situations like this, but allowing whitespace in identifiers likely does require being much more meticulous about treatment of reserved words, identifiers, and whitespace than more traditional syntaxes, and this is likely why not many people attempt this.
I think the idea is worth experimenting with, though, and that a good implementation of it could be convenient enough for end-users to outweigh the implementation inconvenience.