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

Advice for appendLeft() vs. appendRight(). #153

Closed
jdalton opened this issue Oct 17, 2018 · 2 comments
Closed

Advice for appendLeft() vs. appendRight(). #153

jdalton opened this issue Oct 17, 2018 · 2 comments

Comments

@jdalton
Copy link

jdalton commented Oct 17, 2018

Could you provide an example or guidance for when appendLeft() and appendRight() should be used. I'm not sure which situations I should use one or the other.

@alangpierce
Copy link
Collaborator

Hey @jdalton! I wrote up some advice in #109 (comment) that you might find useful.

If you have relatively few operations that you're doing, then it may be convenient to take advantage of the fact that appendLeft things will always be to the left of appendRight things, and that if you intend to call move or slice, you'll keep appendLeft things but not appendRight things, in case you want to include/exclude recently-inserted parens, for example. But for more complex cases, my experience is that the system breaks down and it's best to always do appendLeft and to be careful to do all the operations in left-to-right order.

@jdalton
Copy link
Author

jdalton commented Oct 17, 2018

Thank you @alangpierce!

@jdalton jdalton closed this as completed Oct 17, 2018
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

No branches or pull requests

2 participants