3 ms·
That's GNU C, not standard C. Standard C has no such feature as blocks being expressions. Compound literals are grotesque. The braces have to be proceeded by
by kazinator 2y ago
That's GNU C, not standard C.
Standard C has no such feature as blocks being expressions.
Compound literals are grotesque. The braces have to be proceeded by cast syntax indicating the type. It could be subject to inference. Maybe the current draft has something.
- danhau 2y agoI actually find compound literals quite pleasing, visually. Parentheses, brackets and braces I find can help a lot in guiding your eyes though code. They make it more „regular“, or lessen the „entropy“ (physicists, please don‘t stone me). For this reason I‘ve come to dislike Rust’s braceless if-syntax, after being a die-hard fan. With parentheses it just reads better.