-
Notifications
You must be signed in to change notification settings - Fork 57
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
Rename "Line" and related usages to Closure? #35
Comments
Also, I'm curious if there's a better/shorter/clearer name for this. "scope" and "block" aren't quite right. "A block is the body of a control structure, the body of a function, or a chunk (the file or string with the code where the variable is declared)." A line in this case is the body of a function or the chunk, but not the body of a control structure. |
Is "closure" the word you're looking for here? |
Yes! |
Yes, I think using the correct terminology here would be a good idea. Even for somebody unfamiliar with the term 'closure', using the wrong term 'line' just because it happens to be a familiar word isn't helping anybody, only making things more confusing. Better to have to look up the term and then understand what is going on than be mislead by our usage. |
I found this extremely confusing when looking through the code- many usages of the word "line", and in particular the class "Line" from linearize.lua, are actually referring to a function or file scope, not a single line.
Unfortunately this isn't the same as a scope in general, as it doesn't create a new "Line" class for e.g. stepping inside an if branch; it's mostly just one scope/"Line" class per function, but with an additional one for the file's scope.
Does this sound right to ya'll? I'm not very familiar with the luacheck code, so I might be misunderstanding.
The text was updated successfully, but these errors were encountered: