/usr/share/doc/fweb/html-info/Macros.html is in fweb-doc 1.62-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>FWEB: Macros</title>
<meta name="description" content="FWEB: Macros">
<meta name="keywords" content="FWEB: Macros">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-index.html#Concept-index" rel="index" title="Concept index">
<link href="Parameter-index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Outer-macros.html#Outer-macros" rel="next" title="Outer macros">
<link href="Temporary-comments.html#Temporary-comments" rel="prev" title="Temporary comments">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Macros"></a>
<div class="header">
<p>
Next: <a href="Ratfor.html#Ratfor" accesskey="n" rel="next">Ratfor</a>, Previous: <a href="Languages.html#Languages" accesskey="p" rel="prev">Languages</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Parameter-index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-index.html#Concept-index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="MACROS-and-PREPROCESSING"></a>
<h2 class="chapter">7 MACROS and PREPROCESSING</h2>
<p><small>FWEB</small> offers a built-in preprocessor facility, especially useful for
<small>FORTRAN</small> programmers. It is closely patterned after the C/C++
preprocessor, but with some extensions such as variable numbers of
arguments. In addition, there are some built-in functions that provide
functionality that cannot be emulated by user-defined macros.
</p>
<p>When working with a language such as C that has its own preprocessor,
the question arises when to use that and when to use <small>FWEB</small>’s
facilities. The answer generally comes with experience. Remember that
<small>FWEB</small>’s macros have been expanded by the time the tangled output
file is produced, whereas language-specific preprocessor commands are
just passed through to that file.
</p>
<p>If you’re a <small>FORTRAN</small> programmer, <em>strongly</em> consider the use of
<small>FWEB</small>’s macro facilities; they will simplify your present and future
life by creating more legible codes and reducing programming errors by
eliminating redundant pieces of code. C/C++ programmers may also
appreciate the preprocessor extensions.
</p>
<p>In addition to conventional macro processing, <small>FWEB</small> also offers the
convenience of certain built-in functions that behave in many ways like
macros. As a trivial example, the value of <var>pi</var>the built-in function ‘<samp>$PI</samp>’. Built-in functions are described in
<a href="Built_002din-functions.html#Built_002din-functions">Built-in functions</a>. They can be useful to programmers in all languages.
</p>
<p><small>FWEB</small> recognizes two kinds of macros: <em>outer macros</em>, and <em>WEB
macros</em> (<em>inner macros</em>). Control codes associated with either of
these kinds normally begin the definition part. However, <small>FWEB</small>
macros are sometimes allowed in the code part as well; see <a href="FWEB-macros.html#FWEB-macros">FWEB macros</a>.
</p>
<p>Macros are expanded by <small>FTANGLE</small> only; <small>FWEAVE</small> merely prints
them as they occur in the source file.
</p>
<a name="index-Macros"></a>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="Outer-macros.html#Outer-macros" accesskey="1">Outer macros</a>:</td><td> </td><td align="left" valign="top">Macros copied to beginning of output file (@d).
</td></tr>
<tr><td align="left" valign="top">• <a href="FWEB-macros.html#FWEB-macros" accesskey="2">FWEB macros</a>:</td><td> </td><td align="left" valign="top">Macros and built-in functions expanded by <small>FWEB</small> (@m).
</td></tr>
<tr><td align="left" valign="top">• <a href="Macros-and-formatting.html#Macros-and-formatting" accesskey="3">Macros and formatting</a>:</td><td> </td><td align="left" valign="top">How to format macros for pretty-printing.
</td></tr>
<tr><td align="left" valign="top">• <a href="Preprocessing.html#Preprocessing" accesskey="4">Preprocessing</a>:</td><td> </td><td align="left" valign="top"><small>FWEB</small>’s preprocessing language (@#if, etc.)
</td></tr>
</table>
<hr>
<div class="header">
<p>
Next: <a href="Ratfor.html#Ratfor" accesskey="n" rel="next">Ratfor</a>, Previous: <a href="Languages.html#Languages" accesskey="p" rel="prev">Languages</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Parameter-index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-index.html#Concept-index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|