Civet icon indicating copy to clipboard operation
Civet copied to clipboard

Declaration assertions

Open STRd6 opened this issue 2 years ago • 0 comments

It would be neat to unify pattern matching pins with declaration assertions similar to how Elixir does it: https://elixir-lang.org/getting-started/pattern-matching.html#the-pin-operator

{x, ^y} := z
---
assert(z.y === y, `z.y not equal to y ${z.y} !== ${y}`)
const {x} = z

STRd6 avatar May 03 '23 03:05 STRd6