/usr/share/doc/racket/scribble/reader-internals.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 | <!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>6.2 @ Reader Internals</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: none;" 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="reader.html" class="tocviewlink" 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="tocviewselflink" 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>6 </td><td><a href="internals.html" class="tocviewlink" data-pltdoc="x">Low-<wbr></wbr>Level Scribble API</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.1 </td><td><a href="layers.html" class="tocviewlink" data-pltdoc="x">Scribble Layers</a></td></tr><tr><td align="right">6.2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">@ Reader Internals</a></td></tr><tr><td align="right">6.3 </td><td><a href="core.html" class="tocviewlink" data-pltdoc="x">Structures And Processing</a></td></tr><tr><td align="right">6.4 </td><td><a href="renderer.html" class="tocviewlink" data-pltdoc="x">Renderers</a></td></tr><tr><td align="right">6.5 </td><td><a href="decode.html" class="tocviewlink" data-pltdoc="x">Decoding Text</a></td></tr><tr><td align="right">6.6 </td><td><a href="doclang.html" class="tocviewlink" data-pltdoc="x">Document Language</a></td></tr><tr><td align="right">6.7 </td><td><a href="docreader.html" class="tocviewlink" data-pltdoc="x">Document Reader</a></td></tr><tr><td align="right">6.8 </td><td><a href="xref.html" class="tocviewlink" data-pltdoc="x">Cross-<wbr></wbr>Reference Utilities</a></td></tr><tr><td align="right">6.9 </td><td><a href="tag.html" class="tocviewlink" data-pltdoc="x">Tag Utilities</a></td></tr><tr><td align="right">6.10 </td><td><a href="blueboxes.html" class="tocviewlink" data-pltdoc="x">Blue Boxes Utilities</a></td></tr><tr><td align="right">6.11 </td><td><a href="config.html" class="tocviewlink" data-pltdoc="x">Extending and Configuring Scribble Output</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_2");">►</a></td><td>6.2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">@ Reader Internals</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.2.1 </td><td><a href="#%28part._.Using_the___.Reader%29" class="tocviewlink" data-pltdoc="x">Using the @ Reader</a></td></tr><tr><td align="right">6.2.2 </td><td><a href="#%28part._.Syntax_.Properties%29" class="tocviewlink" data-pltdoc="x">Syntax Properties</a></td></tr><tr><td align="right">6.2.3 </td><td><a href="#%28part._at-exp-lang%29" class="tocviewlink" data-pltdoc="x">Adding @-<wbr></wbr>expressions to a Language</a></td></tr><tr><td align="right">6.2.4 </td><td><a href="#%28part._.Interface%29" class="tocviewlink" data-pltdoc="x">Interface</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">6.2.1<tt> </tt></span><a href="#%28part._.Using_the___.Reader%29" class="tocsubseclink" data-pltdoc="x">Using the @ Reader</a></td></tr><tr><td><span class="tocsublinknumber">6.2.2<tt> </tt></span><a href="#%28part._.Syntax_.Properties%29" class="tocsubseclink" data-pltdoc="x">Syntax Properties</a></td></tr><tr><td><span class="tocsublinknumber">6.2.3<tt> </tt></span><a href="#%28part._at-exp-lang%29" class="tocsubseclink" data-pltdoc="x">Adding @-<wbr></wbr>expressions to a Language</a></td></tr><tr><td><span class="tocsublinknumber">6.2.4<tt> </tt></span><a href="#%28part._.Interface%29" class="tocsubseclink" data-pltdoc="x">Interface</a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-inside%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>inside</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax-inside%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>syntax-<wbr></wbr>inside</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>at-<wbr></wbr>readtable</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-reader%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>at-<wbr></wbr>reader</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._use-at-readtable%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">use-<wbr></wbr>at-<wbr></wbr>readtable</span></span></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="layers.html" title="backward to "6.1 Scribble Layers"" data-pltdoc="x">← prev</a> <a href="internals.html" title="up to "6 Low-Level Scribble API"" data-pltdoc="x">up</a> <a href="core.html" title="forward to "6.3 Structures And Processing"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""reader-internals"">6.2<tt> </tt><a name="(part._reader-internals)"></a>@ Reader Internals</h4><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Using_the___Reader"">6.2.1<tt> </tt><a name="(part._.Using_the___.Reader)"></a>Using the @ Reader</h5><p>You can use the reader via Racket’s <span class="stt">#reader</span> form:</p><blockquote class="SCodeFlow"><p><span class="stt">#reader scribble/reader @foo{This is free-form text!}</span></p></blockquote><p>or use the <span class="RktSym">at-exp</span> meta-language as described in
<a href="#%28part._at-exp-lang%29" data-pltdoc="x">Adding @-expressions to a Language</a>.</p><p>Note that the Scribble reader reads <a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a> as S-expressions. This
means that it is up to you to give meanings for these expressions in
the usual way: use Racket functions, define your functions, or require
functions. For example, typing the above into <span class="stt">racket</span> is likely
going to produce a “reference to undefined identifier” error, unless
<span class="RktSym">foo</span> is defined. You can use <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> instead,
or you can define <span class="RktSym">foo</span> as a function (with variable arity).</p><p>A common use of the Scribble @-reader is when using Scribble as a
documentation system for producing manuals. In this case, the manual
text is likely to start with</p><blockquote class="SCodeFlow"><p><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="docreader.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/doc</span></a></p></blockquote><p>which installs the @ reader starting in “text mode,” wraps the
file content afterward into a Racket module where many useful Racket
and documentation related functions are available, and parses the body
into a document using <a href="decode.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/decode</span></a>. See
<a href="docreader.html" data-pltdoc="x">Document Reader</a> for more information.</p><p>Another way to use the reader is to use the <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._use-at-readtable%29%29" class="RktValLink" data-pltdoc="x">use-at-readtable</a></span>
function to switch the current readtable to a readtable that parses
<a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>. You can do this in a single command line:</p><p><span class="hspace"> </span><span class="stt">racket -ile scribble/reader "(use-at-readtable)"</span></p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Syntax_Properties"">6.2.2<tt> </tt><a name="(part._.Syntax_.Properties)"></a>Syntax Properties</h5><p>The Scribble reader attaches properties to syntax objects. These
properties might be useful in some rare situations.</p><p>Forms that Scribble reads are marked with a <span class="RktVal">'</span><span class="RktVal">scribble</span>
property, and a value of a list of three elements: the first is
<span class="RktVal">'</span><span class="RktVal">form</span>, the second is the number of items that were read from
the datum part, and the third is the number of items in the body part
(strings, sub-forms, and escapes). In both cases, a <span class="RktVal">0</span> means
an empty datum/body part, and <span class="RktVal">#f</span> means that the corresponding
part was omitted. If the form has neither parts, the property is not
attached to the result. This property can be used to give different
meanings to expressions from the datum and the body parts, for
example, implicitly quoted keywords:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><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-syntax%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">foo</span><span class="hspace"> </span><span class="RktSym">stx</span><span class="RktPn">)</span></td></tr><tr><td><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=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><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">p</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=stxprops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax-property%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax-property</a></span><span class="hspace"> </span><span class="RktSym">stx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">scribble</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><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._printf%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">">>> ~s\n"</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax-%7E3edatum%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax->datum</a></span><span class="hspace"> </span><span class="RktSym">stx</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._syntax-case%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktSym">stx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529.__%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">_</a></span><span class="hspace"> </span><span class="RktSym">x</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><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=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._and%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">and</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._pair%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">pair?</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</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=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eq%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">eq?</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._car%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">car</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">form</span><span class="RktPn">)</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=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._even%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">even?</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cadr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cadr</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><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=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><span class="hspace"> </span><span class="RktSym">loop</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">n</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=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252F%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">/</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cadr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cadr</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">as</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">xs</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax-%7E3elist%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax->list</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">x</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></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="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._if%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">if</a></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=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._zero%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">zero?</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._with-syntax%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">with-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">attrs</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=pairs.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Flist..rkt%2529._reverse%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">reverse</a></span><span class="hspace"> </span><span class="RktSym">as</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">x</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">xs</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktRdr">#'</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">foo</span><span class="hspace"> </span><span class="RktVal">`</span><span class="RktVal">attrs</span><span class="hspace"> </span><span class="RktSym">x</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">loop</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=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._sub1%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._with-syntax%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">with-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">key</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._car%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">car</a></span><span class="hspace"> </span><span class="RktSym">xs</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">val</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cadr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cadr</a></span><span class="hspace"> </span><span class="RktSym">xs</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">key</span><span class="hspace"> </span><span class="RktRdr">,</span><span class="RktSym">val</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">as</span><span class="RktPn">)</span></td></tr><tr><td><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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cddr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cddr</a></span><span class="hspace"> </span><span class="RktSym">xs</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p> </p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="stt">@foo[x 1 y (* 2 3)]{blah}</span></td></tr><tr><td><p><span class="RktOut">>>> (foo x 1 y (* 2 3) "blah")</span></p></td></tr><tr><td><p><span class="RktRes">'(foo ((x 1) (y 6)) "blah")</span></p></td></tr></table></td></tr></table></blockquote><p>In addition, the Scribble parser uses syntax properties to mark syntax
items that are not physically in the original source —<wbr></wbr> indentation
spaces and newlines. Both of these will have a <span class="RktVal">'</span><span class="RktVal">scribble</span>
property; an indentation string of spaces will have
<span class="RktVal">'</span><span class="RktVal">indentation</span> as the value of the property, and a newline will
have a <span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">newline</span><span class="stt"> </span><span class="RktVal">S</span><span class="RktVal">)</span> value where <span class="RktSym">S</span> is the original
newline string including spaces that precede and follow it (which
includes the indentation for the following item). This can be used to
implement a verbatim environment: drop indentation strings, and use
the original source strings instead of the single-newline string. Here
is an example of this.</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><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-syntax%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">verb</span><span class="hspace"> </span><span class="RktSym">stx</span><span class="RktPn">)</span></td></tr><tr><td><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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._syntax-case%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktSym">stx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529.__%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">_</a></span><span class="hspace"> </span><span class="RktSym">cmd</span><span class="hspace"> </span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktRdr">#`</span><span class="RktPn">(</span><span class="RktSym">cmd</span></td></tr><tr><td><span class="hspace"> </span><span class="RktRdr">#,@</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%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktSym">loop</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">items</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax-%7E3elist%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax->list</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></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="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._if%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">if</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._null%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">null?</a></span><span class="hspace"> </span><span class="RktSym">items</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span></td></tr><tr><td><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=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">fst</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._car%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">car</a></span><span class="hspace"> </span><span class="RktSym">items</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">prop</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=stxprops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax-property%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax-property</a></span><span class="hspace"> </span><span class="RktSym">fst</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">scribble</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">rst</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">loop</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cdr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cdr</a></span><span class="hspace"> </span><span class="RktSym">items</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="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._cond%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">cond</a></span><span class="hspace"> </span><span class="RktPn">[</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=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eq%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">eq?</a></span><span class="hspace"> </span><span class="RktSym">prop</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">indentation</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">rst</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</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=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._not%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">not</a></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=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._and%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">and</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._pair%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">pair?</a></span><span class="hspace"> </span><span class="RktSym">prop</span><span class="RktPn">)</span></td></tr><tr><td><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=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eq%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">eq?</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._car%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">car</a></span><span class="hspace"> </span><span class="RktSym">prop</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">newline</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="hspace"> </span><span class="RktSym">fst</span><span class="hspace"> </span><span class="RktSym">rst</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><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=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._else%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">else</a></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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">datum->syntax-object</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">fst</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cadr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cadr</a></span><span class="hspace"> </span><span class="RktSym">prop</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">fst</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">rst</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p> </p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="stt">@verb[string-append]{</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="stt">foo</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="stt">bar</span></td></tr><tr><td><span class="hspace"> </span><span class="stt">}</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"foo\n</span><span class="hspace"> </span><span class="RktRes">bar"</span></p></td></tr></table></td></tr></table></blockquote><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""at-exp-lang"">6.2.3<tt> </tt><a name="(part._at-exp-lang)"></a><a name="(mod-path._at-exp)"></a>Adding @-expressions to a Language</h5><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><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="#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">at-exp-lib</span></span></td></tr></table></div><div class="SIntrapara">The <a href="#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a> language installs
<a href="reader.html" data-pltdoc="x">@-reader</a> support in the readtable used to read
a module, and then chains to the reader of
another language that is specified immediately after
<a href="#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a>.</div></p><p>For example, <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><span class="RktSym">at-exp</span><span class="stt"> </span><span class="RktSym">racket/base</span> adds @-reader
support to <span class="RktSym">racket/base</span>, so that</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="#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a><span class="hspace"> </span><span class="RktSym">racket/base</span></td></tr><tr><td><span class="hspace"> </span></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="RktPn">(</span><span class="RktSym">greet</span><span class="hspace"> </span><span class="RktSym">who</span><span class="RktPn">)</span><span class="hspace"> </span><span class="stt">@</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="RktVal">Hello, </span><span class="stt">@|</span><span class="RktSym">who</span><span class="stt">|</span><span class="RktVal">.</span><span class="RktPn">}</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym">greet</span><span class="hspace"> </span><span class="RktVal">"friend"</span><span class="RktPn">)</span></td></tr></table></blockquote><p>reports <span class="RktVal">"Hello, friend."</span>.</p><p>In addition to configuring the reader for a module body,
<a href="#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a> attaches a run-time configuration annotation to
the module, so that it if it used as the main module, the
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-read-interaction%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-read-interaction</a></span> parameter is adjusted to use the
<a href="reader.html" data-pltdoc="x">@-reader</a> readtable extension.</p><p class="SHistory">Changed in version 1.2 of package <span class="stt">at-exp-lib</span>: Added <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-read-interaction%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-read-interaction</a></span>
run-time configuration.</p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""Interface"">6.2.4<tt> </tt><a name="(part._.Interface)"></a><a name="(mod-path._scribble/reader)"></a>Interface</h5><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><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=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._scribble%2Freader%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/reader</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">at-exp-lib</span></span></td></tr></table></div><div class="SIntrapara">The <a href="#%28mod-path._scribble%2Freader%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/reader</span></a> module
provides direct Scribble reader functionality for advanced needs.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._read))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="RktValDef RktValLink" data-pltdoc="x">read</a></span></span><span class="hspace"> </span>[<span class="RktVar">in</span>]<span class="RktPn">)</span><span class="hspace"> </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=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span><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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-input-port%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-input-port</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._read-syntax))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-syntax</a></span></span><span class="hspace"> </span>[<span class="RktVar">source-name</span><span class="hspace"> </span><span class="RktVar">in</span>]<span class="RktPn">)</span><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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax?</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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eof-object%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">eof-object?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">source-name</span><span class="hspace"> </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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><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=inspectors.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._object-name%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">object-name</a></span><span class="hspace"> </span><span class="RktVar">in</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span><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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-input-port%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-input-port</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Implements the Scribble reader using the readtable produced by</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="RktValLink" data-pltdoc="x">make-at-readtable</a></span><span class="hspace"> </span><span class="RktPn">#:command-readtable</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dynamic</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:datum-readtable</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dynamic</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><p class="SHistory">Changed in version 1.1 of package <span class="stt">at-exp-lib</span>: Changed to use <span class="RktVal">'</span><span class="RktVal">dynamic</span> for the command and datum readtables.</p></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._read-inside))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-inside%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-inside</a></span></span><span class="hspace"> </span>[<span class="RktVar">in</span>]<span class="RktPn">)</span><span class="hspace"> </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=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span><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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-input-port%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-input-port</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._read-syntax-inside))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax-inside%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-syntax-inside</a></span></span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">source-name</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">in</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:command-char</span><span class="hspace"> </span><span class="RktVar">command-char</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax?</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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eof-object%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">eof-object?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">source-name</span><span class="hspace"> </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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><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=inspectors.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._object-name%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">object-name</a></span><span class="hspace"> </span><span class="RktVar">in</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span><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=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-input-port%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-input-port</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">command-char</span><span class="hspace"> </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=characters.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._char%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">char?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#\@</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span> and <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span>, but starting as if
inside a <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> to return a (syntactic) list,
which is useful for implementing languages that are textual by default.</div></p><p>The given <span class="RktVar">command-char</span> is used to customize the readtable
used by the reader, effectively passing it along to <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="RktValLink" data-pltdoc="x">make-at-readtable</a></span>.</p><p><div class="SIntrapara"><p class="SHistory">Changed in version 1.1 of package <span class="stt">at-exp-lib</span>: Changed to use <span class="RktVal">'</span><span class="RktVal">dynamic</span> for the command and datum readtables.</p></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._make-at-readtable))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-at-readtable</a></span></span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktPn">#:readtable</span><span class="hspace"> </span><span class="RktVar">readtable</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:command-char</span><span class="hspace"> </span><span class="RktVar">command-char</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:command-readtable</span><span class="hspace"> </span><span class="RktVar">command-readtable</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:datum-readtable</span><span class="hspace"> </span><span class="RktVar">datum-readtable</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:syntax-post-processor</span><span class="hspace"> </span><span class="RktVar">syntax-post-proc</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">readtable</span><span class="hspace"> </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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></span><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=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-readtable%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-readtable</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">command-char</span><span class="hspace"> </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=characters.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._char%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">char?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#\@</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">command-readtable</span><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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dynamic</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVar">readtable</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">datum-readtable</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><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=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></span></td></tr><tr><td><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=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></td></tr><tr><td><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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></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=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</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=readtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._readtable%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">readtable?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dynamic</span><span class="RktPn">)</span></td></tr></table></td><td valign="top"><span class="hspace"> </span></td><td valign="top">=</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVal">#t</span></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">syntax-post-proc</span><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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax?</a></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=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</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=stxops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._syntax%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">syntax?</a></span><span class="RktPn">)</span><span class="hspace"> </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=values.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._values%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">values</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an @-readtable. The keyword arguments can customize the
resulting reader in several ways:</div></p><ul><li><p><span class="RktVar">readtable</span> —<wbr></wbr> a readtable to base the @-readtable
on.</p></li><li><p><span class="RktVar">command-char</span> —<wbr></wbr> the character used for <a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>.</p></li><li><p><span class="RktVar">command-readtable</span> —<wbr></wbr> determines the readtable that is
extended for reading the command part of an <a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a>:</p><ul><li><p>a readtable —<wbr></wbr> extended to make <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> a delimiter
instead of a symbol-quoting character</p></li><li><p><span class="RktVal">'</span><span class="RktVal">dynamic</span> —<wbr></wbr> extends <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=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-readtable%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-readtable</a></span><span class="RktPn">)</span>
at the point where a command is parsed to make <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> a
delimiter</p></li></ul></li><li><p><span class="RktVar">datum-readtable</span> —<wbr></wbr> the readtable used for
reading the datum part of an <a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-form</span></a>:</p><ul><li><p><span class="RktVal">#t</span> —<wbr></wbr> uses the constructed @-readtable itself</p></li><li><p>a readtable —<wbr></wbr> uses the given readtable</p></li><li><p>a readtable-to-readtable function —<wbr></wbr> called to construct a readtable
from the generated @-readtable</p></li><li><p><span class="RktVal">'</span><span class="RktVal">dynamic</span> —<wbr></wbr> uses <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=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-readtable%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-readtable</a></span><span class="RktPn">)</span> at the
point where the datum part is parsed</p></li></ul><p>The idea is that you may want to have completely
different uses for the datum part, for example, introducing a
convenient <span class="RktInBG"><span class="hspace"></span><span class="RktIn">key=val</span><span class="hspace"></span></span> syntax for attributes.</p></li><li><p><span class="RktVar">syntax-post-proc</span> —<wbr></wbr> function that is applied on
each resulting syntax value after it has been parsed (but before it
is wrapped quoting punctuations). You can use this to further
control uses of <a href="reader.html#%28tech._~40._form%29" class="techoutside" data-pltdoc="x"><span class="techinside">@-forms</span></a>, for example, making the command be the
head of a list:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._use-at-readtable%29%29" class="RktValLink" data-pltdoc="x">use-at-readtable</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:syntax-post-processor</span></td></tr><tr><td><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">stx</span><span class="RktPn">)</span></td></tr><tr><td><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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._syntax-case%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktSym">stx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">cmd</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=pairs.html%23%2528def._%2528%2528lib._racket%252Flist..rkt%2529._rest%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">rest</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktRdr">#'</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=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">cmd</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=pairs.html%23%2528def._%2528%2528lib._racket%252Flist..rkt%2529._rest%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">rest</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=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">else</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=exns.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._error%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">error</a></span><span class="hspace"> </span><span class="RktVal">"@ forms must have a body"</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></li></ul><p><div class="SIntrapara"><p class="SHistory">Changed in version 1.1 of package <span class="stt">at-exp-lib</span>: Added <span class="RktPn">#:command-readtable</span> and
the <span class="RktVal">'</span><span class="RktVal">dynamic</span> option for <span class="RktPn">#:datum-readtable</span>.</p></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._make-at-reader))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-reader%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-at-reader</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:syntax?</span><span class="hspace"> </span><span class="RktVar">syntax?</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:inside?</span><span class="hspace"> </span><span class="RktVar">inside?</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><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%2528quote._%7E23%7E25kernel%2529._procedure%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">procedure?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">syntax?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">inside?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a variant of a @-readtable. The arguments are the same
as in <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="RktValLink" data-pltdoc="x">make-at-readtable</a></span>, with two more that determine the
kind of reader function that will be created: <span class="RktVar">syntax?</span> chooses
between a <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>- or <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span>-like function, and
<span class="RktVar">inside?</span> chooses a plain reader or an <span class="RktSym"><span class="nobreak">-i</span>nside</span>
variant.</div></p><p>The resulting function has a different contract and action based on
these inputs. The expected inputs are as in <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span> or
<span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> depending on <span class="RktVar">syntax?</span>; the function will
read a single expression or, if <span class="RktVar">inside?</span> is true, the whole
input; it will return a syntactic list of expressions rather than a
single one in this case.</p><p>Note that <span class="RktVar">syntax?</span> defaults to <span class="RktVal">#t</span>, as this is the
more expected common case when you’re dealing with concrete-syntax
reading.</p><p><div class="SIntrapara">Note that if <span class="RktVar">syntax?</span> is true, the <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>-like function
is constructed by simply converting a syntax result back into a datum.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._scribble/reader..rkt)._use-at-readtable))"></a><span title="Provided from: scribble/reader | Package: at-exp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._use-at-readtable%29%29" class="RktValDef RktValLink" data-pltdoc="x">use-at-readtable</a></span></span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </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=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Passes all arguments to <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Freader..rkt%29._make-at-readtable%29%29" class="RktValLink" data-pltdoc="x">make-at-readtable</a></span>, and installs the
resulting readtable using <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-readtable%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-readtable</a></span>. It also enables
line counting for the current input-port via <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=linecol.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._port-count-lines%2521%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">port-count-lines!</a></span>.</div></p><p>This is mostly useful for playing with the Scribble syntax on the REPL.</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="layers.html" title="backward to "6.1 Scribble Layers"" data-pltdoc="x">← prev</a> <a href="internals.html" title="up to "6 Low-Level Scribble API"" data-pltdoc="x">up</a> <a href="core.html" title="forward to "6.3 Structures And Processing"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|