-
-
Notifications
You must be signed in to change notification settings - Fork 36
Hoisting local variables or not #297
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
Comments
I'd prefer to not allow for that. |
Agreed. You can't use a variable until it is defined.
…On Thu, Sep 15, 2022, 12:11 Zibi Braniecki ***@***.***> wrote:
I'd prefer to not allow for that.
—
Reply to this email directly, view it on GitHub
<#297 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMADD6VFOD4MKAGXQ4TV6NYEPANCNFSM6AAAAAAQNQTI6U>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I'm okay with not hoisting, as long as referring to variables defined earlier is considered valid:
|
+1 to not hoisting as well. Also, I note that this is a revisitable decision, just in case we learn about use-cases for hoisting in the future. Not hoisting today is forward-compatible with hoisting in the future. |
In case if was not clear already :-) |
I think that is still open to discuss (#292) |
Example:
Is there a good use case for
$foo
to be able to refer to$bar
?I can't think of one.
Some programming languages do this, some don't, and I don't think those that don't have major problems.
Not allowing it would make things simpler:
Forked as a sub-issue from #292
The text was updated successfully, but these errors were encountered: