Shorthand for specifying objects with keys and values from current scope
Open
enhancement
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
I find myself having to frequently write things like:
```
{foo: foo, bar: bar, baz: baz}
```
ie. an object that takes some local variable, and includes it under the same name.
I'd like to propose a sugar for this which does `{foo}` -> `{foo: foo}`.
ie. the above example would become `{foo, bar, baz}`.
This is similar in spirit to `jq`'s syntax for this, where `{foo}` -> `{foo: .foo}`.
Contributor guide
Assessment
This issue has not been assessed yet.