folding syntax
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 263
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to propose a folding syntax for single valued objects, loosely inspired by CUE: https://cuelang.org/docs/tutorials/tour/intro/fold/
It's frequently the case that when I want to override a specific property of something nested very deeply, I need to write a lot of encapsulated curly braces, which wastes a lot of lines and screen space.
The other option of folding these and having something like `}}}}}}}` doesn't look much better either, and is error prone.
Instead, we could allow this:
```jsonnet
{
abc+: def+: xyz+: {
foo: "bar"
}
}
```
which would desugar into this:
```jsonnet
{
abc+: {
def+: {
xyz+: {
foo: "bar"
}
}
}
}
```
I think this would make several scenarios much more concise. WDYT @sbarzowski @sparkprime?
Contributor guide
Assessment
This issue has not been assessed yet.