Skip to content
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

Merging mainline coffee #192

Merged
merged 5 commits into from
Aug 26, 2016
Merged

Merging mainline coffee #192

merged 5 commits into from
Aug 26, 2016

Conversation

zapu
Copy link
Collaborator

@zapu zapu commented Aug 25, 2016

Fresh ☕

Not too many changes though.

lydell and others added 5 commits June 10, 2016 08:58
In for example `for` loops, a variable called `i` is generated (for the
loop index). If that name is unavailable, `j` is used instead, then `k`,
`l`, etc. all the way to `z`. Then, `aa`, `ab`, `ac` etc. are used.

This meant that, eventually, `do` would be used, but that's not a valid
variable name since `do` is a JavaScript keyword.

This logic was also inefficiently implemented. For example, going from
`aa` to `ab` or from `az` to `ba` required lots of loop iterations.

This commit changes the variable naming convention. Now, `i`, `j`, `k`,
etc. to `z` are used like before. Then comes `i1`, `j1`, `k1`, etc. Then
`i2`, `j2`, `k2` and so on. This is simpler, efficient and easier to
understand. `i1` is more obvious to be a loop index than `aa`.

Fixes jashkenas#4267.
Improve naming of generated 'i-variables'
@maxtaco
Copy link
Owner

maxtaco commented Aug 25, 2016

👍 Thank you!

@zapu
Copy link
Collaborator Author

zapu commented Aug 26, 2016

Let me know if you want me to do some more here :)

@maxtaco maxtaco merged commit 6d67bc1 into maxtaco:iced3 Aug 26, 2016
@zapu zapu mentioned this pull request Oct 27, 2016
@zapu zapu deleted the coffee-merge branch May 12, 2018 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants