Macro (computer Science)

Macro (computer Science)

A macro (from the Greek μακρό for "big" or "far") in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement input sequence (also often a sequence of characters) according to a defined procedure. The mapping process that instantiates (transforms) a macro use into a specific sequence is known as macro expansion. A facility for writing macros may be provided as part of a software application or as a part of a programming language. In the former case, macros are used to make tasks using the application less repetitive. In the latter case, they are a tool that allows a programmer to enable code reuse or even to design domain-specific languages.

Macros are used to make a sequence of computing instructions available to the programmer as a single program statement, making the programming task less tedious and less error-prone. (Thus, they are called "macros" because a big block of code can be expanded from a small sequence of characters). Macros often allow positional or keyword parameters that dictate what the conditional assembler program generates and have been used to create entire programs or program suites according to such variables as operating system, platform or other factors. The term derives from "macro instruction", and such expansions were originally used in generating assembly language code.

Read more about Macro (computer Science):  Keyboard and Mouse Macros, Text Substitution Macros, Procedural Macros, Syntactic Macros, Macros For Machine-independent Software

Other articles related to "macros, macro":

Macro (computer Science) - Macros For Machine-independent Software
... Macrosare normally used to map a short string macro invocation)to a longer sequence of instructions ... Another,less common,use of macrosis to do the reverse to map a sequence of instructions to a macrostring ... This was the approach taken by the STAGE2 Mobile Programming System,which used a rudimentary macrocompiler called SIMCMP)to map the specific instruction set of a given computer to ...