Difference between revisions of "Macro (computer science)"
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | In [[computer science]], A '''macro''' (short for "macroinstruction") is a rule or pattern that specifies how a certain input sequence (often a sequence of [[Character (computing)|characters]]) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure. | + | In [[computer science]], A '''macro''' (short for "macroinstruction") is a rule or [[pattern]] that specifies how a certain input sequence (often a sequence of [[Character (computing)|characters]]) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure. |
== Description == | == Description == | ||
Line 5: | Line 5: | ||
The mapping process that instantiates (transforms) a macro use into a specific sequence is known as macro expansion. | 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 [[Application software|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. | + | A facility for writing macros may be provided as part of a [[Application software|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 language|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 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. | + | Macros often allow positional or keyword parameters that dictate what the [[Conditional assembly language|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. | ||
== See also == | == See also == |
Latest revision as of 07:54, 4 September 2016
In computer science, A macro (short for "macroinstruction") is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure.
Description
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.
See also
- Assembly language#Macros (the origin of the concept of macros)
- Anaphoric macros
- Hygienic macros
- Macro instruction
- Programming by demonstration
- string interpolation
- Extensible programming
External links
- Macro (computer science) @ Wikipedia.org