Shorthand for "pattern matching" on an object parameter
Open
question
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
One thing I really miss when writing jsonnet after writing Nix for a while is the ability to deconstruct an object being passed in as a parameter. For example:
``` nix
{ a, b, c }: a + b + c
```
is a one-parameter lambda (arguably the only sort that matters!) that expects the caller to pass it a dict with those three keys in it. You can also set defaults and match on the aggregate.
Would it be possible to get something similar in jsonnet?
Contributor guide
Assessment
This issue has not been assessed yet.