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

带上下文遍历 #4

Open
YdrMaster opened this issue Jul 12, 2022 · 1 comment
Open

带上下文遍历 #4

YdrMaster opened this issue Jul 12, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@YdrMaster
Copy link
Owner

YdrMaster commented Jul 12, 2022

当前版本保证遍历是无开销的,但也无法携带上下文。使用时得每次通过当前的 path 判断所在的节点。

应该可以实现一个带上下文的遍历,根据节点进入或退出自动在栈上创建上下文对象。

如果实现这个效果将极大简化遍历的代码。

这个功能将包含在 0.2.0 版本中。

@YdrMaster YdrMaster self-assigned this Jul 12, 2022
@YdrMaster YdrMaster added the enhancement New feature or request label Jul 12, 2022
@YdrMaster YdrMaster linked a pull request Jul 14, 2022 that will close this issue
Closed
@YdrMaster
Copy link
Owner Author

现在看来这个方案不靠谱,因为结构化会导致丧失闭包捕获变量的能力,这导致的便利性损失比增益更大。无论如何这个分支大致的形态已经完成了,可以作为一个有意义的借鉴。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant