You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unambiguity1 makes it easier to understand a programming language.
Therefore, all macros / functions that work differently than expected (as those without a prefix) must be marked with a prefix; and for those that do not require a prefix, it must be forbidden.
This makes it easier to understand when a prefix is required and makes it easier to remember functions and macros (and their names), as there is no need to think about whether this function/macro was or must be defined with or without a prefix.
It's mandatory if it behaves in a "non-function" way.
It's permitted to add @ for macros that are safe. This is to allow macros to be highlighted as potentially "dangerous" even though it is satisfying the "function-like" behaviour. One such reason is if the macro is intended for constant folding and only uses a type:
macrouszalignof($Type)
{
return$Type.alignof;
}
In this case, the code is guaranteed to constant fold, and this might be unexpected, so @alignof is better for the user, although not mandatory. I think I have one (1) macro like that in the stdlib.
Enforce Unambiguity
Unambiguity1 makes it easier to understand a programming language.
Therefore, all macros / functions that work differently than expected (as those without a prefix) must be marked with a prefix; and for those that do not require a prefix, it must be forbidden.
This makes it easier to understand when a prefix is required and makes it easier to remember functions and macros (and their names), as there is no need to think about whether this function/macro was or must be defined with or without a prefix.
Footnotes
Fix discrepancies in std modules #1662 ↩
The text was updated successfully, but these errors were encountered: