biscuit-rust icon indicating copy to clipboard operation
biscuit-rust copied to clipboard

Support for closures

Open divarvel opened this issue 2 years ago • 0 comments

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 results

  • [x] closure support in datalog::expression::Op

  • [x] closure support in format::schema

  • [x] closure support in parser

  • [x] closures for lazy boolean operators

  • [x] closures for .any() and .all()

  • [ ] prevent shadowing in closure arguments (parser, deserialization, execution?)

divarvel avatar Dec 29 '23 10:12 divarvel