RFE: semantics to allow closure calls to take place on non-closures
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
It would be really nice to be able to write something like `std.makeArray(8, 0.0)`, or -- more to the point -- `std.makeArray(4, std.makeArray(5, std.makeArray(5, 0.0)))`, rather than `std.makeArray(4, function(_) std.makeArray(5, function(_) std.makeArray(5, function(_) 0.0)))`.
The easiest way I see to make that work is to add an application rule for non-functions that `\rule{e_0 ↓ e_0', e_0' ∈ {Number, String, Array, Object, Boolean, null}}{e_0(e_1 ... e_m) ↓ e_0})` (or such). This makes the language a little bit gross inasmuch as it makes static checking of it a little less useful, but on the other hand, it really does simplify the syntax for common uses of makeArray...
Contributor guide
Assessment
This issue has not been assessed yet.