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

fix semiautovivification with slices #849

Merged
merged 1 commit into from
Feb 18, 2016

Conversation

rhendric
Copy link
Collaborator

Fixes #847

i = 0
while i < tails.length when delete tails[i++].vivify
@head = Assign Chain(@head, tails.splice 0, i), that!, \= \||
i = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just i--?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tails can contain multiple things in a row that aren't vivifications. The when guard makes i keep incrementing until it finds a vivification, at which point the loop body splices out everything in tails up to that vivification into the Assign. i needs to be reset back to 0 at that point because i elements have been removed from tails.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, duh. I use splice so much I can't even remember its arguments.. Sorry :/.

vendethiel added a commit that referenced this pull request Feb 18, 2016
fix semiautovivification with slices
@vendethiel vendethiel merged commit 057e244 into gkz:master Feb 18, 2016
@vendethiel
Copy link
Contributor

Thanks!

@rhendric rhendric deleted the fix/LiveScript-847 branch May 4, 2023 20:17
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.

2 participants