3 ms·
But "inline" is routinely used in C in "inline functions".. I don't think anyone with a decent amount of experience with C would have trouble quickly seeing wha
by audunw 4y ago
But "inline" is routinely used in C in "inline functions".. I don't think anyone with a decent amount of experience with C would have trouble quickly seeing what inline means in Zig, and those people are the primary target audience for Zig.
It's short and concise IMO.
- AnIdiotOnTheNet 4y agoMakes enough sense to me, although I was using Zig years ago. An inlined function is a function that is not called in the traditional sense and instead its effects are replicated as though the function code had been written at the call site. With `inline for` and `inline while`, the for loop isn't run in the traditional sense and instead is unrolled as though each instance of the loop had been written separately. With `inline else`, every possible instance not covered by a `case` is expanded as though it had been written separately. It's a little weird to C programmers only because C doesn't expand the concept outside of functions.
- krona 4y agoI have a lot of experience with C/C++ and I don't understand what this really has to do with inline expansion or linkage behaviour.
- stephc_int13 4y agoInline has a different meaning in C/C++, and to be honest it was not a very good keyword choice in the first place.