A certain input should be mapped to a replacement output, often used to automate repetitive tasks or sequences of input.

Hygienic macros

Expansion is guaranteed not to cause the accidental capture of identifiers. Hygienic macro systems automatically rename variables to prevent unintentional variable capture—in short, they “just work.” hygiene has never been presented in a formal way, as a specification rather than an algorithm

#define SWAP(x, y) { int temp = x; x = y; y = temp; }
 
int main() {
    int x = 1, y = 2;
    SWAP(x, y);
    printf("x = %d, y = %d\n", x, y); // Output: x = 2, y = 1
 
    int temp = 3;
    SWAP(x, temp); // Oops! Unintended capture of the 'temp' variable
    printf("x = %d, temp = %d\n", x, temp); // Output: x = 2, temp = 3
    return 0;
}