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
Token pasting in the preprocessor is sufficient to introduce a switch/case-like construct; this can act as a vector for variation to propagate through the codebase. This example switches on whether LONG_MAX is 2^31-1, 2^63-1, or undefined:
I originally came up with it as an example case of how the preprocessor is hostile to "partial evaluation", as https://github.com/tendra/tendra attempts to perform, as in their approach LONG_MAX would act as undefined in the initial platform-agnostic preprocessing, resulting in an unconditional assert.
The text was updated successfully, but these errors were encountered:
Conceptually this should be handled in the SuperC lexer that we are using by default (I know that the original TypeChef lexer doesn't handle this correctly).
Token pasting in the preprocessor is sufficient to introduce a switch/case-like construct; this can act as a vector for variation to propagate through the codebase. This example switches on whether
LONG_MAX
is2^31-1
,2^63-1
, or undefined:I originally came up with it as an example case of how the preprocessor is hostile to "partial evaluation", as https://github.com/tendra/tendra attempts to perform, as in their approach
LONG_MAX
would act as undefined in the initial platform-agnostic preprocessing, resulting in an unconditional assert.The text was updated successfully, but these errors were encountered: