4 ms·
All those languages have if-expressions, which is all ?: is.
by edflsafoiewq 4y ago
All those languages have if-expressions, which is all ?: is.
- kbd 4y agoTotally. In fact, if expressions are the very first example of “if” in the Zig manual https://ziglang.org/documentation/master/#if https://ziglang.org/documentation/master/#if Also, Zig is so into expressions over statements that they plan to remove “function definition as statement”, which I think is awesome. In other words, conceptually function definition is a compile-time expression that creates the function. Edit: here’s that Zig rfc: https://github.com/ziglang/zig/issues/1717# https://github.com/ziglang/zig/issues/1717#