-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Numeric literal suffixes live in a parallel lexical scope." #32
Comments
Common numeric literal suffixes would be short identifiers, which will commonly clash with other variables (especially temp vars). Template functions don't have the same issue; they're usually named more like a normal function. Using the same lexical scope would also prevent "explaining" the existing numeric suffixes, which definitely are not overridden by an in-scope |
Why is that? It's not clear to me why they would behave so differently from template functions. Is the naming being similar to variable the only reason? If so I'd tend to disagree: regular functions are generally named using a verb, whereas template functions are generally a name - similar to variables. I didn't feel like it caused confusion, though. |
I think you may have either not read or not appreciated this point. let n = () => {};
0n; Today, |
Thanks for the example, it's clearer now! That being said, while I see the concern, it feels somewhat low compared to adding a whole different syntax. You say it'd be weird to an inexperienced reader authoring a custom unit why Both syntaxes have inconvenience, but it feels to me optimizing for the vastly more common case would yield better results, from a developer experience perspective. |
Why is this parallel lexical scope needed? Intuitively I'd expect extended literal suffixes to work similar to template tags, which live in the same global scope as everything else. Is there a practical issue with allowing to use suffixes as soon as they are imported in the module?
The text was updated successfully, but these errors were encountered: