module std::macrossource
The built-in compile-time macros (LANGUAGE_SPEC.md section 7.4).
Like the standard interfaces, these are declared but not implemented:
a declaration-only macro carries no body, and the compiler supplies the
behavior when one is invoked. Like every macro they are called with a
leading '#' and run at compile time.
macro type_ofsource
exp macro type_of(value) -> type;
The type of the argument expression (section 4.4).
macro struct_typesource
exp macro struct_type() -> type;
A fresh, empty struct type, for synthesising one.
macro enum_typesource
exp macro enum_type() -> type;
A fresh, empty enum type.
macro implementers_ofsource
exp macro implementers_of(target) -> [type];
Every type in the merged unit implementing the interface, whole-world across libraries (section 7.4).
macro name_ofsource
exp macro name_of(value) -> [u8];
The variant name of an enum value, as a string.
macro read_filesource
exp macro read_file(path) -> [u8];
The bytes of a project file, read at compile time as static data. The
path resolves against the entry module's directory and must not escape
it (section 7.2). Distinct from std::io's runtime read_file: this one
is a macro, invoked #read_file(...) during compile-time evaluation.