Kids.Net.Au - Search engine for kids,
teachers, parents, children and schools

Search the Internet for Kids!
Google
 
Web Kids.Net.Au
Sign Up for our Cool Newsletter!
Email:
Web Sites Encyclopedia Dictionary Thesaurus
Search
Google
 
Web
Kids.Net.Au
Encyclopedia
 
Sponsors
 
Encyclopedia > Macro

Article Content

Macro

A programming language macro is a text abstraction, which defines a shorthand for a longer piece of program text. When a macro is defined, the language system (compiler or interpreter) automatically replaces instances of the shorthand text with the expansion.

Languages such as C and assembly language have simple macro systems, implemented as preprocessors to the compiler or assembler. C preprocessor macros work by simple textual search-and-replace. More elaborate macros are available to C programmers by using an additional text-processing language such as M4.

Lisp languages such as Common Lisp and Scheme have more elaborate macro systems. In Lisp, macros behave like functions which can transform the program text, with the full language available to express such transformations. Lisp macros are used to define new syntactic constructs.


There are also keyboard macros and editor macros, used interactively on a graphical user interface and text editor, respectively.



All Wikipedia text is available under the terms of the GNU Free Documentation License

Link to Kids.Net.Au | About Us | Submit a question, comment or suggestion

Kids.Net.Au - kids safe portal for children, parents, schools and teachers.