-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support for closures #202
Open
divarvel
wants to merge
22
commits into
v5
Choose a base branch
from
closures
base: v5
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support for closures #202
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- recursive closure evaluation - no support for serialization nor parsing
instead of calling `Expression.evaluate` recursively, push the closure to the ops vector
no support for nested closures and proper parameter substitution yet
It also includes a list of parameter names for proper parameter evaluation
Closures are all evaluated through recursive calls now
divarvel
commented
May 22, 2024
They are not parsed anymore, but we need to be aware if older operators are still used.
This only happens during evaluation. Earlier checks depend on changes from #179
CodSpeed Performance ReportMerging #202 will not alter performanceComparing Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v5 #202 +/- ##
==========================================
- Coverage 58.27% 58.13% -0.15%
==========================================
Files 23 23
Lines 4664 4820 +156
==========================================
+ Hits 2718 2802 +84
- Misses 1946 2018 +72 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this branch is to explore how to add support for closures in the stack machine
closures are represented as a list of ops and a list of parameter names
closure parameters can be used like variables
variable names must be unique, so shadowing is forbidden
boolean operators use laziness and push the rhs closure on the ops list only if needed (without recursion)
.any()
and.all()
use recursion to compute resultsclosure support in
datalog::expression::Op
closure support in
format::schema
closure support in
parser
closures for lazy boolean operators
closures for
.any()
and.all()
prevent shadowing in closure arguments
print
And
andOr
with&&!
and||!
, without parsing them.v5 block detection depends on Add HeterogeneousEqual and HeterogeneousNotEqual to binary operation #220