-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support for closures #202
Conversation
- 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
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 67.91% 68.57% +0.66%
==========================================
Files 25 25
Lines 5507 5681 +174
==========================================
+ Hits 3740 3896 +156
- Misses 1767 1785 +18 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
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
parsing & deserialization depends on feat: detect free variables in rule expressions #179will be done in a dedicated PRprint
And
andOr
with&&!
and||!
, without parsing them.v5 block detection depends on Add HeterogeneousEqual and HeterogeneousNotEqual to binary operation #220