Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Macro (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Text-substitution macros== {{unreferenced section|date=September 2024}} {{See also|General-purpose macro processor|Assembly language#Macros|Algorithm}} Languages such as [[C (programming language) |C]] and some [[assembly language]]s have rudimentary macro systems, implemented as [[preprocessor]]s to the compiler or assembler. [[C preprocessor]] macros work by simple textual substitution at the [[Lexical token|token]], rather than the character level. However, the macro facilities of more sophisticated assemblers, e.g., [[IBM High Level Assembler]] (HLASM) can't be implemented with a preprocessor; the code for assembling instructions and data is interspersed with the code for assembling macro invocations. A classic use of macros is in the computer typesetting system [[TeX]] and its derivatives, where most functionality is based on macros.<ref>{{cite web |last1=Fine |first1=Johnathan |title=T E X forever! |url=http://svn.tug.org/TUGboat/tb27-0/fine.pdf |website=Tex Users Group |access-date=6 December 2024 |page=141 |quote=TEX has a macro programming language, which allows features to be added.}}</ref> [[MacroML]] is an experimental system that seeks to reconcile [[static typing]] and macro systems. [[Nemerle]] has typed syntax macros, and one productive way to think of these syntax macros is as a [[Metaprogramming|multi-stage computation]]. Other examples: * [[m4 (computer language)|m4]] is a sophisticated stand-alone macro processor. * [[TRAC programming language|TRAC]] * [[METAL|Macro Extension TAL]], accompanying [[Template Attribute Language]] * SMX: for web pages * [[ML/I|ML/1]] (Macro Language One) * [[troff]] and [[nroff]]: for typesetting and formatting Unix manpages. * [[CMS EXEC]]: for command-line macros and application macros * [[EXEC 2]] in [[Conversational Monitor System]] (CMS): for command-line macros and application macros * [[CLIST]] in IBM's [[Time Sharing Option]] (TSO): for command-line macros and application macros * [[REXX]]: for command-line macros and application macros in, e.g., [[AmigaOS]], CMS, [[OS/2]], TSO * [[SCRIPT (markup)#SCRIPT macros|SCRIPT]]: for formatting documents * Various [[Shell (computing)#Text (CLI) shells|shells]] for, e.g., [[Linux]] Some major applications have been written as text macro invoked by other applications, e.g., by [[XEDIT]] in CMS. ===Embeddable languages=== Some languages, such as [[PHP]], can be embedded in free-format text, or the source code of other languages. The mechanism by which the code fragments are recognised (for instance, being bracketed by <code><?php</code> and <code>?></code>) is similar to a textual macro language, but they are much more powerful, fully featured languages.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)