/usr/share/doc/racket/scribble/reader.html is in racket-doc 6.7-3.
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>2 @ Syntax</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Scribble:<span class="mywbr"> </span> The Racket Documentation Tool</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="getting-started.html" class="tocviewlink" data-pltdoc="x">Getting Started</a></td></tr><tr><td align="right">2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">@ Syntax</a></td></tr><tr><td align="right">3 </td><td><a href="generic-prose.html" class="tocviewlink" data-pltdoc="x">High-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">4 </td><td><a href="plt-manuals.html" class="tocviewlink" data-pltdoc="x">Scribbling Documentation</a></td></tr><tr><td align="right">5 </td><td><a href="lp.html" class="tocviewlink" data-pltdoc="x">Literate Programming</a></td></tr><tr><td align="right">6 </td><td><a href="internals.html" class="tocviewlink" data-pltdoc="x">Low-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">7 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running <span class="stt">scribble</span></a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">@ Syntax</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.1 </td><td><a href="#%28part._.The_.Scribble_.Syntax_at_a_.Glance%29" class="tocviewlink" data-pltdoc="x">The Scribble Syntax at a Glance</a></td></tr><tr><td align="right">2.2 </td><td><a href="#%28part._.The_.Command_.Part%29" class="tocviewlink" data-pltdoc="x">The Command Part</a></td></tr><tr><td align="right">2.3 </td><td><a href="#%28part._.The_.Datum_.Part%29" class="tocviewlink" data-pltdoc="x">The Datum Part</a></td></tr><tr><td align="right">2.4 </td><td><a href="#%28part._.The_.Body_.Part%29" class="tocviewlink" data-pltdoc="x">The Body Part</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">2.1<tt> </tt></span><a href="#%28part._.The_.Scribble_.Syntax_at_a_.Glance%29" class="tocsubseclink" data-pltdoc="x">The Scribble Syntax at a Glance</a></td></tr><tr><td><span class="tocsublinknumber">2.2<tt> </tt></span><a href="#%28part._.The_.Command_.Part%29" class="tocsubseclink" data-pltdoc="x">The Command Part</a></td></tr><tr><td><span class="tocsublinknumber">2.3<tt> </tt></span><a href="#%28part._.The_.Datum_.Part%29" class="tocsubseclink" data-pltdoc="x">The Datum Part</a></td></tr><tr><td><span class="tocsublinknumber">2.4<tt> </tt></span><a href="#%28part._.The_.Body_.Part%29" class="tocsubseclink" data-pltdoc="x">The Body Part</a></td></tr><tr><td><span class="tocsublinknumber">2.4.1<tt> </tt></span><a href="#%28part._alt-body-syntax%29" class="tocsubseclink" data-pltdoc="x">Alternative Body Syntax</a></td></tr><tr><td><span class="tocsublinknumber">2.4.2<tt> </tt></span><a href="#%28part._.Racket_.Expression_.Escapes%29" class="tocsubseclink" data-pltdoc="x">Racket Expression Escapes</a></td></tr><tr><td><span class="tocsublinknumber">2.4.3<tt> </tt></span><a href="#%28part._.Comments%29" class="tocsubseclink" data-pltdoc="x">Comments</a></td></tr><tr><td><span class="tocsublinknumber">2.4.4<tt> </tt></span><a href="#%28part._.Spaces__.Newlines__and_.Indentation%29" class="tocsubseclink" data-pltdoc="x">Spaces, Newlines, and Indentation</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="getting-started.html" title="backward to "1 Getting Started"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">up</a> <a href="generic-prose.html" title="forward to "3 High-Level Scribble API"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""reader"">2<tt> </tt><a name="(part._reader)"></a>@ Syntax</h3><p>The Scribble @ notation is designed to be a convenient facility for
free-form text in Racket code, where “@” was chosen as one of the
least-used characters in existing Racket code. An @-expression is
simply an S-expression in disguise.</p><p>Typically, @ notation is enabled through
<a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> or similar languages, but you can also
add @ notation to an S-expression-based language using the
<a href="reader-internals.html#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a> meta-language. For example,</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">#lang at-exp racket</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">(define v '@op{str})</span></p></td></tr></table></p><p>is equivalent to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">v</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">op</span><span class="hspace"> </span><span class="RktVal">"str"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Using <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="reader-internals.html#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a><span class="stt"> </span><span class="RktSym">racket</span> is probably the easiest way to try the examples
in this chapter.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""The_Scribble_Syntax_at_a_Glance"">2.1<tt> </tt><a name="(part._.The_.Scribble_.Syntax_at_a_.Glance)"></a>The Scribble Syntax at a Glance</h4><p>To review <a href="getting-started.html#%28part._how-to~3areader%29" data-pltdoc="x">@ Syntax Basics</a>, the concrete syntax of <a name="(tech._~40._form)"></a><span style="font-style: italic">@-forms</span>
is roughly</p><blockquote class="SCodeFlow"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">datum</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">text-body</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></blockquote><p>where all three parts after <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> are optional, but at least
one should be present. (Spaces are not allowed between the
three parts.) Roughly, a form matching the above grammar is read as</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">datum</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span><span class="sroman">*</span><span class="RktPn">)</span></p></blockquote><p>where <span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span> is the translation of each
<span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> in the input. Thus, the initial <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span>
determines the Racket code that the input is translated into. The
common case is when <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> is a Racket identifier, which reads
as a plain Racket form, with datum arguments and/or string arguments.</p><p>Here is one example:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{blah blah blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"blah blah blah"</span><span class="RktPn">)</span></td></tr></table></p><p>The example shows how an input syntax is read as Racket syntax, not
what it evaluates to. If you want to see the translation of an example
into S-expression form, add a quote in front of it in a
<a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="reader-internals.html#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a><span class="stt"> </span><span class="RktSym">racket</span> module. For example, running</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">#lang at-exp racket</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">'@foo{blah blah blah}</span></p></td></tr></table></p><p>in DrRacket prints the output</p><blockquote><p><span class="RktRes">(foo<span class="stt"> </span>"blah blah blah")</span></p></blockquote><p>while omitting the quote</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">#lang at-exp racket</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">@foo{blah blah blah}</span></p></td></tr></table></p><p>triggers a syntax error because <span class="RktSym">foo</span> is not bound, and</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">#lang at-exp racket</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">(define (foo str) (printf "He wrote ~s.\n" str))</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">@foo{blah blah blah}</span></p></td></tr></table></p><p>prints the output</p><blockquote><p><span class="RktOut">He wrote "blah blah blah".</span></p></blockquote><p>Here are more examples of <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{blah "blah" (`blah'?)}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"blah \"blah\" (`blah'?)"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[1 2]{3 4}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">"3 4"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[1 2 3 4]</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[#:width 2]{blah blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktPn">#:width</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">"blah blah"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{blah blah</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">yada yada}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"blah blah"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"yada yada"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">blah blah</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">yada yada</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"blah blah"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"yada yada"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>As seen in the last example, multiple lines and the newlines that
separate them are parsed to multiple Racket strings. More generally,
a <span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> is made of text, newlines, and nested
<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>, where the syntax for <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> is the same whether it’s
in a <span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> context as in a Racket context. A
<span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> that isn’t an <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> is converted to a string
expression for its <span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span>; newlines and following
indentations are converted to <span class="RktVal">"\n"</span> and all-space string
expressions.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar @baz{3}</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">blah}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">baz</span><span class="hspace"> </span><span class="RktVal">"3"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{@b{@u[3] @u{4}}</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">blah}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">b</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">u</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">u</span><span class="hspace"> </span><span class="RktVal">"4"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@C{while (*(p++))</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">*p = '\n';}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">C</span><span class="hspace"> </span><span class="RktVal">"while (*(p++))"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"*p = '\\n';"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>The command part of an <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> is optional as well. In that case,
the <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> is read as a list, which usually counts as a function
application, but it also useful when quoted with the usual Racket
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=quote.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._quote%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">quote</a></span>:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{blah blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah blah"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{blah @[3]}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">'@{foo</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="RktVal">)</span></td></tr></table></td></tr></table></p><p>Finally, we can also drop the datum and text parts, which leaves us with
only the command—<wbr></wbr>which is read as is, not within a parenthesized
form. This is not useful when reading Racket code, but it can be used
inside a text block to escape a Racket identifier. A vertical bar
(<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span>) can be used to delimit the escaped identifier when
needed.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktSym">foo</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{blah @foo blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah "</span><span class="hspace"> </span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" blah"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{blah @foo: blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah "</span><span class="hspace"> </span><span class="RktSym">foo:</span><span class="hspace"> </span><span class="RktVal">" blah"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{blah @|foo|: blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah "</span><span class="hspace"> </span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">": blah"</span><span class="RktPn">)</span></td></tr></table></p><p>Actually, the command part can be any Racket expression (that does not
start with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span>), which is
particularly useful with such escapes since they can be used with any
expression.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{(+ 1 2) -> @(+ 1 2)!}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"(+ 1 2) -> "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"!"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{A @"string" escape}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"A string escape"</span><span class="RktPn">)</span></td></tr></table></p><p>Note that an escaped Racket string is merged with the surrounding text
as a special case. This is useful if you want to use the special
characters in your string, but escaping braces are not necessary if
they are balanced.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{eli@"@"barzilay.org}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"eli@barzilay.org"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{A @"{" begins a block}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"A { begins a block"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@C{while (*(p++)) {</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">*p = '\n';</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">}}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">C</span><span class="hspace"> </span><span class="RktVal">"while (*(p++)) {"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"*p = '\\n';"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"}"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>In some cases, a text contains many literal @s, which can be
cumbersome to quote individually. For such case, braces have an
alternative syntax: A block of text can begin with a
“<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{</span><span class="hspace"></span></span>” and terminated accordingly with a
“<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}|</span><span class="hspace"></span></span>”. Furthermore, any nested <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> must begin
with a “<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|@</span><span class="hspace"></span></span>”.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{bar}@{baz}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar}@{baz"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{bar |@x{X} baz}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">"X"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" baz"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{bar |@x|{@}| baz}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">"@"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" baz"</span><span class="RktPn">)</span></td></tr></table></p><p>In cases when even this is not convenient enough, punctuation
characters can be added between the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> and the braces and the
@ in nested forms. (The punctuation is mirrored for parentheses
and <span class="RktInBG"><span class="hspace"></span><span class="RktIn"><></span><span class="hspace"></span></span>s.) With this extension, <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> syntax can be used as a
“here string” replacement.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|--{bar}@|{baz}--|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar}@|{baz"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|<<{bar}@|{baz}>>|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar}@|{baz"</span><span class="RktPn">)</span></td></tr></table></p><p>On the flip side of this is, how can an @ sign be used in Racket
code? This is almost never an issue, because Racket strings and
characters are still read the same, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> is set as a
non-terminating reader macro so it can be used in Racket identifiers
anywhere except in the first character of an identifier. When
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> must appear as the first character of an identifier, you
must quote the identifier just like other non-standard characters in
normal S-expression syntax: with a backslash or with vertical bars.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(define \@email "foo@bar.com")</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace"> </span><span class="RktSym">@email</span><span class="hspace"> </span><span class="RktVal">"foo@bar.com"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(define |@atchar| #\@)</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace"> </span><span class="RktSym">@atchar</span><span class="hspace"> </span><span class="RktVal">#\@</span><span class="RktPn">)</span></td></tr></table></p><p>Note that spaces are not allowed before a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span> or a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>, or they will be part of the following text (or Racket
code). (More on using braces in body texts below.)</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar @baz[2 3] {4 5}}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">baz</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" {4 5}"</span><span class="RktPn">)</span></td></tr></table></p><p>Finally, remember that <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> are just an alternate form of
S-expressions. Identifiers still get their meaning, as in any
Racket code, through the lexical context in which they appear.
Specifically, when the above <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> appears in a Racket expression
context, the lexical environment must provide bindings for
<span class="RktSym">foo</span> as a procedure or a macro; it can be defined, required,
or bound locally (with <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=let.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._let%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">let</a></span>, for example).</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=let.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._let%252A%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">let*</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">formatter</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">fmt</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktSym">args</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._format%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">format</a></span><span class="hspace"> </span><span class="RktSym">fmt</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=procedures.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._apply%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">apply</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string-append%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string-append</a></span><span class="hspace"> </span><span class="RktSym">args</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">bf</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">formatter</span><span class="hspace"> </span><span class="RktVal">"*~a*"</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">it</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">formatter</span><span class="hspace"> </span><span class="RktVal">"/~a/"</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">ul</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">formatter</span><span class="hspace"> </span><span class="RktVal">"_~a_"</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">text</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string-append%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string-append</a></span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="stt">@text{@it{Note}: @bf{This is @ul{not} a pipe}.}</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"/Note/: *This is _not_ a pipe*."</span></p></td></tr></table></blockquote><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""The_Command_Part"">2.2<tt> </tt><a name="(part._.The_.Command_.Part)"></a>The Command Part</h4><p>Besides being a Racket identifier, the <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> part of an
<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> can have Racket punctuation prefixes, which will end up
wrapping the <span style="font-style: italic">whole</span> expression.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@`',@foo{blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktVal">`</span><span class="RktVal">'</span><span class="RktVal">,@</span><span class="RktVal">(</span><span class="RktVal">foo</span><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktVal">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@#`#'#,@foo{blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktRdr">#`</span><span class="RktRdr">#'</span><span class="RktRdr">#,@</span><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></p><p>When writing Racket code, this means that <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@`',@foo{blah}</span><span class="hspace"></span></span>
is exactly the same as <span class="RktInBG"><span class="hspace"></span><span class="RktIn">`@',@foo{blah}</span><span class="hspace"></span></span> and
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">`',@@foo{blah}</span><span class="hspace"></span></span>, but unlike the latter two, the first
construct can appear in body texts with the same meaning, whereas the
other two would not work (see below).</p><p>After the optional punctuation prefix, the <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> itself is not
limited to identifiers; it can be <span style="font-style: italic">any</span> Racket expression.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@(lambda (x) x){blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@`(unquote foo){blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktRdr">,</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktVal">)</span></td></tr></table></p><p>In addition, the command can be omitted altogether, which will omit it
from the translation, resulting in an S-expression that usually
contains, say, just strings:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{foo bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktVal">"foo bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@'{foo bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"foo bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="RktVal">)</span></td></tr></table></td></tr></table></p><p>If the command part begins with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span> (with no newline between
the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> and the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span>), then the construct is a
comment. There are two comment forms, one for arbitrary-text and
possibly nested comments, and another one for line comments:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;{</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">any</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">anything-else-without-newline</span>›</span><span class="sroman">*</span></td></tr></table></blockquote><p>In the first form, the commented body must still parse correctly; see
the description of the body syntax below. In the second form, all
text from the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;</span><span class="hspace"></span></span> to the end of the line <span style="font-style: italic">and</span> all
following spaces (or tabs) are part of the comment (similar to
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">%</span><span class="hspace"></span></span> comments in TeX).</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar @; comment</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz@;</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">blah}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar bazblah"</span><span class="RktPn">)</span></td></tr></table></p><p>Tip: if you use an editor in some Scheme mode without support for
<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>, balanced comments can be confusing, since the open brace
looks commented out, and the closing one isn’t. In such cases it is
useful to “comment” out the closing brace too:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">@;{</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">...</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">;}</span></p></td></tr></table></p><p>so the editor does not treat the file as having unbalanced
parentheses.</p><p>If only the <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> part of an <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> is specified, then the
result is the command part only, without an extra set of parenthesis.
This makes it suitable for Racket escapes in body texts. (More on this
below, in the description of the body part.)</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x @y z}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"x "</span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktVal">" z"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x @(* y 2) z}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"x "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" z"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@{@foo bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="RktPn">)</span></td></tr></table></p><p>Finally, note that there are currently no special rules for using
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> in the command itself, which can lead to things like:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@@foo{bar}{baz}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="RktPn">)</span></td></tr></table></p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""The_Datum_Part"">2.3<tt> </tt><a name="(part._.The_.Datum_.Part)"></a>The Datum Part</h4><p>The datum part can contains arbitrary Racket expressions, which
are simply stacked before the body text arguments:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[1 (* 2 3)]{bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[@bar{...}]{blah}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">"..."</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></p><p>The body part can still be omitted, which is essentially an
alternative syntax for plain (non-textual) S-expressions:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[bar]</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktSym">bar</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar @f[x] baz}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" baz"</span><span class="RktPn">)</span></td></tr></table></p><p>The datum part can be empty, which makes no difference, except when
the body is omitted. It is more common, however, to use an empty body
for the same purpose.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[]{bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[]</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktSym">foo</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="RktPn">)</span></td></tr></table></p><p>The most common use of the datum part is for Racket forms that expect
keyword-value arguments that precede the body of text arguments.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[#:style 'big]{bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktPn">#:style</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">big</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr></table></p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""The_Body_Part"">2.4<tt> </tt><a name="(part._.The_.Body_.Part)"></a>The Body Part</h4><p>The syntax of the body part is intended to be as convenient as
possible for free text. It can contain almost any text—<wbr></wbr>the only
characters with special meaning is <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> for sub-<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>,
and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> for the end of the text. In addition, a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> is allowed as part of the text, and it makes the
matching <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> be part of the text too—<wbr></wbr>so balanced braces
are valid text.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{f{o}o}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"f{o}o"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{{{}}{}}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"{{}}{}"</span><span class="RktPn">)</span></td></tr></table></p><p>As described above, the text turns to a sequence of string arguments
for the resulting form. Spaces at the beginning and end of lines are
discarded, and newlines turn to individual <span class="RktVal">"\n"</span> strings
(i.e., they are not merged with other body parts); see also the
information about newlines and indentation below. Spaces are
<span style="font-style: italic">not</span> discarded if they appear after the open <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>
(before the closing <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>) when there is also text that
follows (precedes) it; specifically, they are preserved in a
single-line body.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar }</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar "</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo[1]{ bar }</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">" bar "</span><span class="RktPn">)</span></td></tr></table></p><p>If <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> appears in a body, then it is interpreted as Racket
code, which means that the @-reader is applied recursively, and the
resulting syntax appears as part of the S-expression, among other
string contents.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{a @bar{b} c}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"a "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">"b"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" c"</span><span class="RktPn">)</span></td></tr></table></p><p>If the nested @ construct has only a command—<wbr></wbr>no body or datum
parts—<wbr></wbr>it will not appear in a subform. Given that the command part
can be any Racket expression, this makes @ a general escape to
arbitrary Racket code.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{a @bar c}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"a "</span><span class="hspace"> </span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">" c"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{a @(bar 2) c}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"a "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" c"</span><span class="RktPn">)</span></td></tr></table></p><p>This is particularly useful with strings, which can be used to include
arbitrary text.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{A @"}" marks the end}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"A } marks the end"</span><span class="RktPn">)</span></td></tr></table></p><p>Note that the escaped string is (intentionally) merged with the rest
of the text. This works for <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> too:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{The prefix: @"@".}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"The prefix: @."</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{@"@x{y}" --> (x "y")}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"@x{y} --> (x \"y\")"</span><span class="RktPn">)</span></td></tr></table></p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""alt-body-syntax"">2.4.1<tt> </tt><a name="(part._alt-body-syntax)"></a>Alternative Body Syntax</h5><p>In addition to the above, there is an alternative syntax for the body,
one that specifies a new marker for its end: use <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{</span><span class="hspace"></span></span> for
the opening marker to have the text terminated by a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}|</span><span class="hspace"></span></span>.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{...}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"..."</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{"}" follows "{"}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"\"}\" follows \"{\""</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{Nesting |{is}| ok}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"Nesting |{is}| ok"</span><span class="RktPn">)</span></td></tr></table></p><p>This applies to sub-<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> too—<wbr></wbr>the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> must be
prefixed with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span>:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|{Maze</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">|@bar{is}</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">Life!}|</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"Maze"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">"is"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"Life!"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@t|{In |@i|{sub|@"@"s}| too}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">t</span><span class="hspace"> </span><span class="RktVal">"In "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">i</span><span class="hspace"> </span><span class="RktVal">"sub@s"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" too"</span><span class="RktPn">)</span></td></tr></table></p><p>Note that the subform uses its own delimiters, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{...}</span><span class="hspace"></span></span> or
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{...}|</span><span class="hspace"></span></span>. This means that you can copy and paste Scribble
text with <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> freely, just prefix the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> if the
immediate surrounding text has a prefix.</p><p>For even better control, you can add characters in the opening
delimiter, between the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> and the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>.
Characters that are put there (non alphanumeric ASCII characters only,
excluding <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span>) should also be used for
sub-<a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>, and the end-of-body marker should have these characters
in reverse order with paren-like characters (<span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span>,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn"><</span><span class="hspace"></span></span>) mirrored.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|<<<{@x{foo} |@{bar}|.}>>>|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"@x{foo} |@{bar}|."</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo|!!{X |!!@b{Y}...}!!|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"X "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">b</span><span class="hspace"> </span><span class="RktVal">"Y"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"..."</span><span class="RktPn">)</span></td></tr></table></p><p>Finally, remember that you can use an expression escape with a Racket
string for confusing situations. This works well when you only need
to quote short pieces, and the above works well when you have larger
multi-line body texts.</p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Racket_Expression_Escapes"">2.4.2<tt> </tt><a name="(part._.Racket_.Expression_.Escapes)"></a>Racket Expression Escapes</h5><p>In some cases, you may want to use a Racket identifier (or a number or
a boolean etc.) in a position that touches the following text; in
these situations you should surround the escaped Racket expression by
a pair of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> characters. The text inside the bars is
parsed as a Racket expression.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@bar.}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktSym">bar.</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@|bar|.}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">"."</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@3.}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktVal">3.0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@|3|.}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">"."</span><span class="RktPn">)</span></td></tr></table></p><p>This form is a generic Racket expression escape, there is no body text
or datum part when you use this form.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@|(f 1)|{bar}}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace"> </span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"{bar}"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{foo@|bar|[1]{baz}}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"foo"</span><span class="hspace"> </span><span class="RktSym">bar</span><span class="hspace"> </span><span class="RktVal">"[1]{baz}"</span><span class="RktPn">)</span></td></tr></table></p><p>This works for string expressions too, but note that unlike the above,
the string is (intentionally) not merged with the rest of the text:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x@"y"z}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"xyz"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x@|"y"|z}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"x"</span><span class="hspace"> </span><span class="RktVal">"y"</span><span class="hspace"> </span><span class="RktVal">"z"</span><span class="RktPn">)</span></td></tr></table></p><p>Expression escapes also work with <span style="font-style: italic">any</span> number of expressions,</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x@|1 (+ 2 3) 4|y}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"x"</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">"y"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x@|*</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">*|y}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"x"</span><span class="hspace"> </span><span class="RktSym">*</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">*</span><span class="hspace"> </span><span class="RktVal">"y"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>It seems that <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@||</span><span class="hspace"></span></span> has no purpose—<wbr></wbr>but remember that these escapes
are never merged with the surrounding text, which can be useful when
you want to control the sub expressions in the form.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{Alice@||Bob@|</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">|Carol}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"Alice"</span><span class="hspace"> </span><span class="RktVal">"Bob"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"Carol"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>Note that <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@|{...}|</span><span class="hspace"></span></span> can be parsed as either an escape expression or
as the Racket command part of an <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a>. The latter is used in this case
(since there is little point in Racket code that uses braces.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@|{blah}|</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Comments"">2.4.3<tt> </tt><a name="(part._.Comments)"></a>Comments</h5><p>As noted above, there are two kinds of <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> comments: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;{...}</span><span class="hspace"></span></span> is
a (nestable) comment for a whole body of text (following the same
rules for <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>), and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;...</span><span class="hspace"></span></span> is a line-comment.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{First line@;{there is still a</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">newline here;}</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">Second line}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"First line"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"Second line"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>One useful property of line-comments is that they continue to the end
of the line <span style="font-style: italic">and</span> all following spaces (or tabs). Using this,
you can get further control of the subforms.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{A long @;</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">single-@;</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">string arg.}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"A long single-string arg."</span><span class="RktPn">)</span></td></tr></table></p><p>Note how this is different from using <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@||</span><span class="hspace"></span></span>s in that strings
around it are not merged.</p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Spaces__Newlines__and_Indentation"">2.4.4<tt> </tt><a name="(part._.Spaces__.Newlines__and_.Indentation)"></a>Spaces, Newlines, and Indentation</h5><p>The <a href="#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a> syntax treats spaces and newlines in a special way is
meant to be sensible for dealing with text. As mentioned above,
spaces at the beginning and end of body lines are discarded, except
for spaces between a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> and text, or between text and a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar}</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar }</span><span class="hspace"></span></span></p></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar "</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz }</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz "</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>A single newline that follows an open brace or precedes a closing
brace is discarded, unless there are only newlines in the body; other
newlines are read as a <span class="RktVal">"\n"</span> string</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p> </p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p> </p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p> </p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p> </p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz }</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz "</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>Spaces at the beginning of body lines do not appear in the resulting
S-expressions, but the column of each line is noticed, and all-space
indentation strings are added so the result has the same indentation.
A indentation string is added to each line according to its distance
from the leftmost syntax object (except for empty lines). (Note: if
you try these examples on a Racket REPL, you should be aware that
the reader does not know about the “<span class="RktInBG"><span class="hspace"></span><span class="RktIn">></span><span class="hspace"> </span></span>” prompt.)</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">blah</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"blah"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">begin</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">x++;</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">end}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"begin"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"x++;"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"end"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">a</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">b</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">c}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"a"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">" "</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"b"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"c"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>If the first string came from the opening <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> line, it is
not prepended with an indentation (but it can affect the leftmost
syntax object used for indentation). This makes sense when formatting
structured code as well as text (see the last example in the following
block).</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bbb}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bbb"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bbb}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">" "</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bbb"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bbb}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">"bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bbb"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bbb}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bbb"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{ bar</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">baz</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">bbb}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktVal">" bar"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"baz"</span><span class="hspace"> </span><span class="RktVal">"\n"</span><span class="hspace"> </span><span class="RktVal">"</span><span class="hspace"> </span><span class="RktVal">"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"bbb"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><p></p></td><td><p></p></td><td><p></p></td></tr><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@text{Some @b{bold</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">text}, and</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">more text.}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">text</span><span class="hspace"> </span><span class="RktVal">"Some "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">b</span><span class="hspace"> </span><span class="RktVal">"bold"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"text"</span><span class="RktPn">)</span><span class="RktVal">", and"</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"more text."</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><p>Note that each @-form is parsed to an S-expression that has its own
indentation. This means that Scribble source can be indented like
code, but if indentation matters then you may need to apply
indentation of the outer item to all lines of the inner one. For
example, in</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@code{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">begin</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">i = 1, r = 1</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">@bold{while i < n do</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">r *= i++</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">done}</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">end</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td></tr></table></p><p>a formatter will need to apply the 2-space indentation to the
rendering of the <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span> body.</p><p>Note that to get a first-line text to be counted as a leftmost line,
line and column accounting should be on for the input port
(<span class="RktSym"><a href="reader-internals.html#%28def._%28%28lib._scribble%2Freader..rkt%29._use-at-readtable%29%29" class="RktValLink" data-pltdoc="x">use-at-readtable</a></span> turns them on for the current input port).
Without this,</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x1</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">x2</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">x3}</span><span class="hspace"></span></span></p></td></tr></table></p><p>will not have 2-space indentations in the parsed S-expression if
source accounting is not on, but</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{x1</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">x2</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">x3}</span><span class="hspace"></span></span></p></td></tr></table></p><p>will (due to the last line). Pay attention to this, as it can be a
problem with Racket code, for example:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@code{(define (foo x)</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">(+ x 1))}</span><span class="hspace"></span></span></p></td></tr></table></p><p>For rare situations where spaces at the beginning (or end) of lines
matter, you can begin (or end) a line with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@||</span><span class="hspace"></span></span>.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@foo{</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">@|| bar @||</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">@|| baz}</span><span class="hspace"></span></span></p></td></tr></table></td><td><p><span class="hspace"> </span>reads as<span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">" bar "</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">" baz"</span><span class="RktPn">)</span></td></tr></table></td></tr></table></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="getting-started.html" title="backward to "1 Getting Started"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">up</a> <a href="generic-prose.html" title="forward to "3 High-Level Scribble API"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|