differential-datalog
differential-datalog copied to clipboard
Allow pattern matches in `for`, `FlatMap`, closures
We currently don't allow any of the following:
for ((k,v) in map)
(var x, var y) = FlatMap(expr)
|(x,y)| x+y
Also if ((k,v) = z)
, which evaluates to true
only if the pattern matching succeeds.
I would prefer a rust-like if let (k, v) = z {}
so it's clear that pattern matching is happening
I am with @Kixiron on this one. if ((k,v) = z)
is very unorthodox. I haven't seen this in any other language.
if let (k, v) = z {}
on the other hand is just syntactic sugar around match
.