FACTOID # 51: Russia won the first World Air Games, held in Turkey in 1997. Events included hang-gliding, sky-surfing, and ballooning.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Macros" also viewed:
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Macros
Macro (meaning "large" or "wide") is also applied to macroeconomics, and macroscopic or "macro" lenses.
Macro (meaning a kind of close-up photography) is found at Macro photography.

A macro is an abstraction, whereby a certain textual pattern is replaced according to a defined set of rules. The interpreter or compiler automatically replaces the pattern when it is encountered. In compiled languages, macro-expansion always happens at compile-time.


The purpose of macros is to either automate frequently-used sequences or enable a more powerful abstraction — but these are often the same thing.


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 transforming program text, with the full language available to express such transformations.


Whereas a C macro may define a simple replacement of one piece of syntax with another, a Lisp macro can control the evaluation of sections of code, creating new syntactic constructs indistinguishable from those built into the language. For instance, in a Lisp dialect that has cond but lacks if, it is possible to define the latter in terms of the former using macros. Entire major extensions to Lisp syntax, such as the CLOS system for object-oriented programming, have been defined as macros.


Keyboard macros

Keyboard macros and editor macros are used interactively on a graphical user interface and text editor, respectively. These allow short sequences of keystrokes substitute for long sequences of commands, and can provide a simple form of automation for repetitive tasks.


The programmers' text editor Emacs (short for "editing macros") follows this idea to a conclusion. In effect, most of the editor is made of macros. Emacs was originally devised as a set of macros in the editing language TECO; it was later ported to dialects of Lisp.


Macro languages

A macro language is a programming language in which all or most computation is done by expanding macros. Macro languages are not widely used for general-purpose programming, but are common in text processing applications. Examples include M4 (mentioned previously), Visual Basic Scripting (Microsoft), Internet Macros (iOpus), and TeX.


Microsoft Word and macro viruses

Visual Basic for Applications (VBA), is a programming language in Microsoft Office. This is not, by the above definition, a macro language at all. However, its function has evolved from and replaced the idea of macros in end-user applications, so it is popularly and mistakenly called a macro language.


VBA has access to many operating system functions and supports automatic execution of macros when a document is opened. This makes it possible to write computer viruses in this language. In the mid-to-late 1990s, macro viruses became one of the most common types of computer virus. Other projects with macro languages, such as OpenOffice.org, have deliberately excluded certain functionality (e.g., automatic execution) from their macro language so as to avoid susceptibility to this program. However, such features are popular in a corporate setting.


  Results from FactBites:
 
Macro Express Home Page (212 words)
Macro Express is the premier Windows macro utility.
A macro is a way to automate a task that you perform repeatedly or on a regular basis.
Macro Express will pay for itself after just a few hours of increased productivity.
Macro International | Home (129 words)
A recent Macro analysis on HIV infections within married couples in Africa has challenged AIDS prevention practitioners and policymakers to look at significant new sources of infection...
Macro International delivers research-based solutions to complex problems.
We help governments and businesses increase their impact on the world—enhancing performance and improving lives.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.