Special syntax for `std.trace` – similar to assert
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
Debugging with std.trace can be annoying, because a large part of the code may need to be parenthesized. It would be nicer if the following syntax was possible:
```
trace foo;
[rest of the code]
```
Instead of:
```
std.trace(
foo,
[rest of the code]
)
```
It raises a question whether we have a similar problem with normal functions. I think it's much less of an issue, because trace statements are expected to be added and removed very quickly ad-hoc during debugging, so dealing with formatting and indentation is most painful for it. Also it is used for side-effects and tracing in some sense doesn't care about the rest of the code following it, so this syntax makes sense for it.
Contributor guide
Assessment
This issue has not been assessed yet.