Hello all,
I was looking through the standard library of C3, and I noticed that some of the macros start with @
and some do not. Is there a meaning behind this? Are there semantics attached to this, or is it just a style thing?
Thanks for any help,
clerno
September 8, 2024, 8:10pm
2
@
is required on macros that violate function semantics, so:
Macros with compile time constant arguments (because then they might get compile time folded.
Macros with “ref” arguments, since those implicitly capture addresses.
Macros with “expr” arguments, since this means delayed lazy evaluation of the arguments
Macros that take a trailing body
Macros that only have type and regular parameters are allowed to skip the requirement.
The motivation is that @
should alert the user that the call possibly violates call expectations in different ways.
That makes sense. Thanks for the response!
1 Like