Reflection
- There are several built-in functions to inspect the code during compile time.
.lenon arrays return their length.$defined(<expr>)returns true if the expression inside is defined.$alignof(<expr>)returns alignment.$sizeof(<expr>)returns size.$checks(<expr>)returns true if the expression inside is valid.$qnameof(<identifier>)to get the qualified name of the identifier, e.gstd::io::printf$nameof(<identifier>)to get the base name of the identifier, e.g.printf$typeof(<expr>)returns the type of the expression.$stringify(<expr>)returns the expression as a string.<type>.sizeofreturns the size of a type.<type>.alignofreturns the alignment of a type.<type>.nameofreturn the name of a type.
See https://c3-lang.org/reflection/ for the full details.