Macro expansion

/ˈmækroʊ ɪkˈspænʃən/ noun

Definition

The process where a preprocessor or compiler replaces macro calls with their corresponding code definitions. Macros are expanded before compilation, allowing code templates to be reused and customized.

Etymology

From Greek 'makros' meaning large or long, contrasting with 'micro.' The term originated in assembly language programming in the 1960s, where macros allowed programmers to define reusable instruction sequences. 'Expansion' refers to the replacement process that 'expands' the macro name into its full definition.

Kelly Says

Macro expansion is like having a really smart copy-paste system that can customize what it pastes - when you write MAX(a,b), the preprocessor expands it to ((a) > (b) ? (a) : (b)) before the compiler even sees it! This is why C macros can be both powerful and dangerous - they're literally text replacement, not function calls.

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.