v0.10-alpha #15
iWas-Coder
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
C with string interpolation? 🤔 No more confusing format specifiers? No way! 😮
Yeah, Carbon is that great 🎉
As you saw, we're using these 2 new things:
%$
placeholder: in the same old printf-style, these automatically can infer the type of the variable, and use the appropriate formatting for it. Obviously, you can still use the specific format specifiers if you prefer to do so. 😉$(...)
boxing macro: these are used to wrap around the variables you want to print using the%$
placeholder. As C cannot do any reflection or compile-time type manipulation, we need to do the work at runtime with this handy-dandy macro. 😎Warning
The $(...) boxing macro only works with lvalues, i.e. variables stored in a way where its address can be retrieved with the
&
operator.Also, logging functions have been reorganized (
carbon_log_info
,carbon_log_warn
,carbon_log_error
), which uses our string interpolation mechanism under the hood.Full Changelog: v0.9-alpha...v0.10-alpha
Note
carbon-0.10-macos-aarch64.tgz ::
a8b6043a1d03da75af1b40941945f0cb8233db2c41e6e21816d94767bd12bdf1
This discussion was created from the release v0.10-alpha.
Beta Was this translation helpful? Give feedback.
All reactions