Token Metaprogramming module

This module provides various macros for metaprogramming on/with tokens/text

Defines

#define CONCAT(...)
Concatenates an arbitrary number of arguments.
#define CONCAT_DEFERRED(...)
Concatenates an arbitrary number of arguments, with one additional layer of indirection.
#define CONCAT0(...)
Concatenates zero arguments.
#define CONCAT1(A)
Concatenates nothing to one argument (returns the given argument)
#define CONCAT2(A, B)
Concatenates the two arguments.
#define CONCAT2_DEFERRED(A, B)
Concatenates the two arguments with one additional layer of indirection.
#define CONCAT3(A, B, C)
Concatenates the three arguments.
#define CONCAT4(A, B, C, D)
Concatenates the four arguments.
#define CONCAT5(A, B, C, D, E)
Concatenates the five arguments.
#define CONCAT6(A, B, C, D, E, F)
Concatenates the 6 arguments.
#define CONCAT7(A, B, C, D, E, F, G)
Concatenates the 7 arguments.
#define CONCAT8(A, B, C, D, E, F, G, H)
Concatenates the 8 arguments.
#define CONCAT9(A, B, C, D, E, F, G, H, I)
Concatenates the 9 arguments.
#define CONCAT10(A, B, C, D, E, F, G, H, I, J)
Concatenates the 10 arguments.
#define CONCAT11(A, B, C, D, E, F, G, H, I, J, K)
Concatenates the 11 arguments.
#define CONCAT12(A, B, C, D, E, F, G, H, I, J, K, L)
Concatenates the 12 arguments.
#define CONCAT13(A, B, C, D, E, F, G, H, I, J, K, L, M)
Concatenates the 13 arguments.
#define AS_STRING(x)
Stringifies the given textual argument.

Define documentation

#define CONCAT(...)

Concatenates an arbitrary number of arguments.

Parameters
... - The arguments to concatenate

The arguments must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT_DEFERRED(...)

Concatenates an arbitrary number of arguments, with one additional layer of indirection.

Parameters
... - The arguments to concatenate

The arguments must be alphanumeric, macro-concatenation compatible sequences of characters. This is useful for use in a macro chain when the result must be deferred through one-further stage of macro replacement than the normal CONCAT(...) provides

#define CONCAT0(...)

Concatenates zero arguments.

Parameters
... - The arguments that will not be concatenated
Returns nothing

#define CONCAT1(A)

Concatenates nothing to one argument (returns the given argument)

Parameters
A - the argument to concatenate nothing to
Returns A

#define CONCAT2(A, B)

Concatenates the two arguments.

Parameters
A - the left-side portion of the concatenation
B - the right-side portion of the concatenation
Returns the concatenation of A and B

A and B must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT2_DEFERRED(A, B)

Concatenates the two arguments with one additional layer of indirection.

Parameters
A - the left-side portion of the concatenation
B - the right-side portion of the concatenation
Returns the concatenation of A and B

A and B must be alphanumeric, macro-concatenation compatible sequences of characters This is useful for use in a macro chain when the result must be deferred through one-further stage of macro replacement than the normal CONCAT2(A, B) provides

#define CONCAT3(A, B, C)

Concatenates the three arguments.

Parameters
A - the left-side portion of the concatenation
B - the middle portion of the concatenation
C - the right-side portion of the concatenation
Returns the concatenation of A, B, and C

A, B, and C must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT4(A, B, C, D)

Concatenates the four arguments.

Parameters
A - the left-side portion of the concatenation
B - the left-middle portion of the concatenation
C - the right-middle portion of the concatenation
D - the right-side portion of the concatenation
Returns the concatenation of A, B, C, and D

A, B, C, and D must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT5(A, B, C, D, E)

Concatenates the five arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
Returns the concatenation of A, B, C, D, E

A, B, C, D, E must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT6(A, B, C, D, E, F)

Concatenates the 6 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
Returns the concatenation of A, B, C, D, E, F

A, B, C, D, E, F must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT7(A, B, C, D, E, F, G)

Concatenates the 7 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G

A, B, C, D, E, F, G must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT8(A, B, C, D, E, F, G, H)

Concatenates the 8 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H

A, B, C, D, E, F, G, H must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT9(A, B, C, D, E, F, G, H, I)

Concatenates the 9 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
I - the ninth portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H, I

A, B, C, D, E, F, G, H, I must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT10(A, B, C, D, E, F, G, H, I, J)

Concatenates the 10 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
I - the ninth portion of the concatenation
J - the tenth portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H, I, J

A, B, C, D, E, F, G, H, I, J must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT11(A, B, C, D, E, F, G, H, I, J, K)

Concatenates the 11 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
I - the ninth portion of the concatenation
J - the tenth portion of the concatenation
K - the eleventh portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H, I, J, K

A, B, C, D, E, F, G, H, I, J, K must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT12(A, B, C, D, E, F, G, H, I, J, K, L)

Concatenates the 12 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
I - the ninth portion of the concatenation
J - the tenth portion of the concatenation
K - the eleventh portion of the concatenation
L - the twelfth portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H, I, J, K, L

A, B, C, D, E, F, G, H, I, J, K, L must be alphanumeric, macro-concatenation compatible sequences of characters

#define CONCAT13(A, B, C, D, E, F, G, H, I, J, K, L, M)

Concatenates the 13 arguments.

Parameters
A - the first portion of the concatenation
B - the second portion of the concatenation
C - the third portion of the concatenation
D - the fourth portion of the concatenation
E - the fifth portion of the concatenation
F - the sixth portion of the concatenation
G - the seventh portion of the concatenation
H - the eight portion of the concatenation
I - the ninth portion of the concatenation
J - the tenth portion of the concatenation
K - the eleventh portion of the concatenation
L - the twelfth portion of the concatenation
M - the thirteenth portion of the concatenation
Returns the concatenation of A, B, C, D, E, F, G, H, I, J, K, L, M

A, B, C, D, E, F, G, H, I, J, K, L, M must be alphanumeric, macro-concatenation compatible sequences of characters

#define AS_STRING(x)

Stringifies the given textual argument.

Parameters
x - The text to stringify
Returns x as a string literal

Converts the given argument into a string literal, performing macro expansion if necessary