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

lazy value stack #14

Open
goodmami opened this issue May 14, 2020 · 1 comment
Open

lazy value stack #14

goodmami opened this issue May 14, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@goodmami
Copy link
Owner

Values are now computed as soon as an expression succeeds, even if that value will later be discarded. Since a parse is inherently a tree, a stack should be able to compute the full derivation. Thus we could have a value stack with (start, end, function) triples. This means that a new tuple is created for each expression that emits values, but that is already the case as the emitted values args is an immutable tuple and not a list. The difference then is that the function is not computed until it is needed. Since there are now callables for Capture and Bind, all features can be represented this way (although in some tests, Capture and Bind were a bit slower than the ~ and : operators).

@goodmami goodmami added the enhancement New feature or request label May 14, 2020
@goodmami
Copy link
Owner Author

Adding to this: a flat stack needs both start and end markers to recreate "branches" so it knows how many arguments go with an action.

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

No branches or pull requests

1 participant