/usr/share/doc/racket/reference/stx-patterns.html is in racket-doc 6.1-4.
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 | <!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>12.1 Pattern-Based Syntax Matching</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.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"><span style="font-weight: bold">The Racket Reference</span></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="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="tocviewselflink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13 </td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15 </td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16 </td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17 </td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</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>12 </td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">12.1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Pattern-<wbr></wbr>Based Syntax Matching</a></td></tr><tr><td align="right">12.2 </td><td><a href="stxops.html" class="tocviewlink" data-pltdoc="x">Syntax Object Content</a></td></tr><tr><td align="right">12.3 </td><td><a href="stxcmp.html" class="tocviewlink" data-pltdoc="x">Syntax Object Bindings</a></td></tr><tr><td align="right">12.4 </td><td><a href="stxtrans.html" class="tocviewlink" data-pltdoc="x">Syntax Transformers</a></td></tr><tr><td align="right">12.5 </td><td><a href="stxparam.html" class="tocviewlink" data-pltdoc="x">Syntax Parameters</a></td></tr><tr><td align="right">12.6 </td><td><a href="splicing.html" class="tocviewlink" data-pltdoc="x">Local Binding with Splicing Body</a></td></tr><tr><td align="right">12.7 </td><td><a href="stxprops.html" class="tocviewlink" data-pltdoc="x">Syntax Object Properties</a></td></tr><tr><td align="right">12.8 </td><td><a href="stxcerts.html" class="tocviewlink" data-pltdoc="x">Syntax Taints</a></td></tr><tr><td align="right">12.9 </td><td><a href="Expanding_Top-Level_Forms.html" class="tocviewlink" data-pltdoc="x">Expanding Top-<wbr></wbr>Level Forms</a></td></tr><tr><td align="right">12.10 </td><td><a href="include.html" class="tocviewlink" data-pltdoc="x">File Inclusion</a></td></tr><tr><td align="right">12.11 </td><td><a href="syntax-util.html" class="tocviewlink" data-pltdoc="x">Syntax Utilities</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax-<wbr></wbr>case</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%2A%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax-<wbr></wbr>case*</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">with-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">quasisyntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">unsyntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax-splicing%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">unsyntax-<wbr></wbr>splicing</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%2Floc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax/<span class="mywbr"> </span>loc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%2Floc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">quasisyntax/<span class="mywbr"> </span>loc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._quote-syntax%2Fprune%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">quote-<wbr></wbr>syntax/<span class="mywbr"> </span>prune</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-rules%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax-<wbr></wbr>rules</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-id-rules%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax-<wbr></wbr>id-<wbr></wbr>rules</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._define-syntax-rule%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>syntax-<wbr></wbr>rule</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="tocsublink" data-pltdoc="x"><span class="RktMeta"><span class="RktStxLink">...</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">_</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-pattern-variable~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">syntax-<wbr></wbr>pattern-<wbr></wbr>variable?</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.1", "../");" 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.1");">top</a></span><span class="navright"> <a href="Macros.html" title="backward to "12 Macros"" data-pltdoc="x">← prev</a> <a href="Macros.html" title="up to "12 Macros"" data-pltdoc="x">up</a> <a href="stxops.html" title="forward to "12.2 Syntax Object Content"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""stx-patterns"">12.1<tt> </tt><a name="(part._stx-patterns)"></a>Pattern-Based Syntax Matching</h4><p><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>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax-case))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax-case</a></span></span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">clause</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="stt"> </span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="specgrammar"><tr><td align="right" valign="baseline"><span class="RktVar">clause</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">result-expr</span><span class="RktPn">]</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">fender-expr</span><span class="hspace"> </span><span class="RktVar">result-expr</span><span class="RktPn">]</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">pattern</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">_</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">id</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#&</span><span class="RktVar">pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">stat-pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">const</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">stat-pattern</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">id</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">stat-pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">stat-pattern</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">stat-pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">stat-pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">const</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">ellipsis</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Finds the first <span class="RktVar">pattern</span> that matches the syntax object
produced by <span class="RktVar">stx-expr</span>, and for which the corresponding
<span class="RktVar">fender-expr</span> (if any) produces a true value; the result is
from the corresponding <span class="RktVar">result-expr</span>, which is in tail position
for the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> form. If no <span class="RktVar">clause</span> matches, then
the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3asyntax%29%29" class="RktValLink" data-pltdoc="x">exn:fail:syntax</a></span> exception is raised; the exception is generated by calling
<span class="RktSym"><a href="exns.html#%28def._%28%28quote._~23~25kernel%29._raise-syntax-error%29%29" class="RktValLink" data-pltdoc="x">raise-syntax-error</a></span> with <span class="RktVal">#f</span> as the “name” argument,
a string with a generic error message, and the result of <span class="RktVar">stx-expr</span>.</div></p><p>A syntax object matches a <span class="RktVar">pattern</span> as follows:</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktVar">_</span></td></tr></table></blockquote><p>A <span class="RktVar">_</span> pattern (i.e., an identifier with the same binding as
<span class="RktVar">_</span>) matches any syntax object.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktVar">id</span></td></tr></table></blockquote><p>An <span class="RktVar">id</span> matches any syntax object when it is not bound to
<span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span> or <span class="RktVar">_</span> and does not have the same binding as
any <span class="RktVar">literal-id</span>. The <span class="RktVar">id</span> is further bound as
<a name="(tech._pattern._variable)"></a><span style="font-style: italic">pattern variable</span> for the corresponding <span class="RktVar">fender-expr</span>
(if any) and <span class="RktVar">result-expr</span>. A pattern-variable binding is a
transformer binding; the pattern variable can be reference only
through forms like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxLink" data-pltdoc="x">syntax</a></span>. The binding’s value is the syntax
object that matched the pattern with a <a name="(tech._depth._marker)"></a><span style="font-style: italic">depth marker</span> of
<span style="font-style: italic"></span>0<span style="font-style: italic"></span>.</p><p>An <span class="RktVar">id</span> that has the same binding as a <span class="RktVar">literal-id</span>
matches a syntax object that is an identifier with the same binding
in the sense of <span class="RktSym"><a href="stxcmp.html#%28def._%28%28quote._~23~25kernel%29._free-identifier~3d~3f%29%29" class="RktValLink" data-pltdoc="x">free-identifier=?</a></span>. The match does not
introduce any <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variables</span></a>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>A <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> pattern matches a syntax object whose datum
form (i.e., without lexical information) is a list with as many
elements as sub-<span class="RktVar">pattern</span>s in the pattern, and where each
syntax object that corresponds to an element of the list matches
the corresponding sub-<span class="RktVar">pattern</span>.</p><p>Any <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variables</span></a> bound by the sub-<span class="RktVar">pattern</span>s are
bound by the complete pattern; the bindings must all be distinct.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr></table></blockquote><p>The last <span class="RktVar">pattern</span> must not be a <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...</span><span class="RktPn">)</span>,
<span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...+</span><span class="stt"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span>, <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktVar">ellipsis</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...</span><span class="RktPn">)</span>, or <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktVar">ellipsis</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...</span><span class="stt"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span> form.</p><p>Like the previous kind of pattern, but matches syntax objects that
are not necessarily lists; for <span style="font-style: italic">n</span> sub-<span class="RktVar">pattern</span>s before
the last sub-<span class="RktVar">pattern</span>, the syntax object’s datum must be a
pair such that <span style="font-style: italic">n-</span>1<span style="font-style: italic"></span> <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cdr%29%29" class="RktValLink" data-pltdoc="x">cdr</a></span>s produce pairs. The last
sub-<span class="RktVar">pattern</span> is matched against the syntax object
corresponding to the <span style="font-style: italic">n</span>th <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cdr%29%29" class="RktValLink" data-pltdoc="x">cdr</a></span> (or the
<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._datum-~3esyntax%29%29" class="RktValLink" data-pltdoc="x">datum->syntax</a></span> coercion of the datum using the nearest
enclosing syntax object’s lexical context and source location).</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like the <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> kind of pattern, but matching a
syntax object with any number (zero or more) elements that match the
sub-<span class="RktVar">pattern</span> followed by <span class="RktVar">ellipsis</span> in the
corresponding position relative to other sub-<span class="RktVar">pattern</span>s.</p><p>For each pattern variable bound by the sub-<span class="RktVar">pattern</span> followed
by <span class="RktVar">ellipsis</span>, the larger pattern binds the same pattern
variable to a list of values, one for each element of the syntax
object matched to the sub-<span class="RktVar">pattern</span>, with an incremented
<a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth marker</span></a>. (The sub-<span class="RktVar">pattern</span> itself may contain
<span class="RktVar">ellipsis</span>, leading to a pattern variables bound to lists of
lists of syntax objects with a <a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth marker</span></a> of <span style="font-style: italic"></span>2<span style="font-style: italic"></span>, and
so on.)</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like the previous kind of pattern, but with a final
sub-<span class="RktVar">pattern</span> as for <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta">...+</span><span class="stt"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span>. The
final <span class="RktVar">pattern</span> never matches a syntax object whose datum is a
pair.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like a <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> pattern, but matching a vector syntax object
whose elements match the corresponding sub-<span class="RktVar">pattern</span>s.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like a <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktVar">ellipsis</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> pattern,
but matching a vector syntax object whose elements match the
corresponding sub-<span class="RktVar">pattern</span>s.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#&</span><span class="RktVar">pattern</span></td></tr></table></blockquote><p>Matches a box syntax object whose content matches the
<span class="RktVar">pattern</span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like a <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> pattern, but matching a <a href="structures.html#%28tech._prefab%29" class="techoutside" data-pltdoc="x"><span class="techinside">prefab</span></a>
structure syntax object whose fields match the corresponding
sub-<span class="RktVar">pattern</span>s. The <span class="RktVar">key-datum</span> must correspond to a
valid first argument to <span class="RktSym"><a href="structutils.html#%28def._%28%28quote._~23~25kernel%29._make-prefab-struct%29%29" class="RktValLink" data-pltdoc="x">make-prefab-struct</a></span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like a <span class="RktPn">(</span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktVar">ellipsis</span><span class="stt"> </span><span class="RktVar">pattern</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> pattern,
but matching a <a href="structures.html#%28tech._prefab%29" class="techoutside" data-pltdoc="x"><span class="techinside">prefab</span></a> structure syntax object whose elements
match the corresponding sub-<span class="RktVar">pattern</span>s.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">stat-pattern</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Matches the same as <span class="RktVar">stat-pattern</span>, which is like a <span class="RktVar">pattern</span>,
but identifiers with the binding <span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span> are treated the same as
other <span class="RktVar">id</span>s.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktVar">const</span></td></tr></table></blockquote><p>A <span class="RktVar">const</span> is any datum that does not match one of the
preceding forms; a syntax object matches a <span class="RktVar">const</span> pattern
when its datum is <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span> to the <span class="RktSym"><a href="quote.html#%28form._%28%28quote._~23~25kernel%29._quote%29%29" class="RktStxLink" data-pltdoc="x">quote</a></span>d
<span class="RktVar">const</span>.</p></blockquote><p>If <span class="RktVar">stx-expr</span> produces a syntax object that is <a href="stxcerts.html#%28tech._tainted%29" class="techoutside" data-pltdoc="x"><span class="techinside">tainted</span></a>
or <a href="stxcerts.html#%28tech._armed%29" class="techoutside" data-pltdoc="x"><span class="techinside">armed</span></a>, then any syntax object bound by a <span class="RktVar">pattern</span>
are <a href="stxcerts.html#%28tech._tainted%29" class="techoutside" data-pltdoc="x"><span class="techinside">tainted</span></a>—<wbr></wbr>unless the binding corresponds to the whole
syntax object produced by <span class="RktVar">stx-expr</span>, in which case it remains
<a href="stxcerts.html#%28tech._tainted%29" class="techoutside" data-pltdoc="x"><span class="techinside">tainted</span></a> or <a href="stxcerts.html#%28tech._armed%29" class="techoutside" data-pltdoc="x"><span class="techinside">armed</span></a>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-syntax%29%29" class="RktStxLink" data-pltdoc="x">for-syntax</a></span><span class="hspace"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-syntax%29%29" class="RktStxLink" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace"> </span><span class="RktSym">stx</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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" 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="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">_</span><span class="hspace"> </span><span class="RktSym">a</span><span class="hspace"> </span><span class="RktSym">b</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">t</span><span class="hspace"> </span><span class="RktSym">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"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span><span class="hspace"> </span><span class="RktSym">a</span><span class="hspace"> </span><span class="RktSym">b</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="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span><span class="hspace"> </span><span class="RktSym">b</span><span class="hspace"> </span><span class="RktSym">t</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><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktVal">10</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">swap</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</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="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(10 5)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">ops</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="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._~3d~3e%29%29" class="RktStxLink" data-pltdoc="x">=></a></span><span class="hspace"> </span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._~3d~3e%29%29" class="RktStxLink" data-pltdoc="x">=></a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">_</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="hspace"> </span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._~3d~3e%29%29" class="RktStxLink" data-pltdoc="x">=></a></span><span class="hspace"> </span><span class="RktSym">op</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">op</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">#<syntax:564:0 (+ 1 2 3)></span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktVal">9</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">z</span><span class="hspace"> </span><span class="RktVal">12</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"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">z</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"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">var</span><span class="hspace"> </span><span class="RktSym">expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">body</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">var</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">expr</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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><span class="RktRes">'(#<syntax:565:0 (x y z)> #<syntax:565:0 (5 9 12)>)</span></p></td></tr></table></blockquote></td></tr></table></p><p><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>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax-case*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%2A%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax-case*</a></span></span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">id-compare-expr</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">clause</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span>, but <span class="RktVar">id-compare-expr</span> must produce a
procedure that accepts two arguments. A <span class="RktVar">literal-id</span> in a
<span class="RktVar">pattern</span> matches an identifier for which the procedure
returns true when given the identifier to match (as the first argument)
and the identifier in the <span class="RktVar">pattern</span> (as the second argument).</div></p><p>In other words, <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> is like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%2A%29%29" class="RktStxLink" data-pltdoc="x">syntax-case*</a></span> with
an <span class="RktVar">id-compare-expr</span> that produces <span class="RktSym"><a href="stxcmp.html#%28def._%28%28quote._~23~25kernel%29._free-identifier~3d~3f%29%29" class="RktValLink" data-pltdoc="x">free-identifier=?</a></span>.</p><p><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>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._with-syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">with-syntax</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span>, in that it matches a <span class="RktVar">pattern</span>
to a syntax object. Unlike <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span>, all <span class="RktVar">pattern</span>s
are matched, each to the result of a corresponding <span class="RktVar">stx-expr</span>,
and the pattern variables from all matches (which must be distinct)
are bound with a single <span class="RktVar">body</span> sequence. The result of the
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span> form is the result of the last <span class="RktVar">body</span>,
which is in tail position with respect to the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span>
form.</div></p><p>If any <span class="RktVar">pattern</span> fails to match the corresponding
<span class="RktVar">stx-expr</span>, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3asyntax%29%29" class="RktValLink" data-pltdoc="x">exn:fail:syntax</a></span> exception is raised.</p><p>A <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span> form is roughly equivalent to the following
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> form:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</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="RktVar">pattern</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></blockquote><p>However, if any individual <span class="RktVar">stx-expr</span> produces a
non-<a href="syntax-model.html#%28tech._syntax._object%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax object</span></a>, then it is converted to one using
<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._datum-~3esyntax%29%29" class="RktValLink" data-pltdoc="x">datum->syntax</a></span> and the lexical context and source location of
the individual <span class="RktVar">stx-expr</span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><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="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-syntax%29%29" class="RktStxLink" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">hello</span><span class="hspace"> </span><span class="RktSym">stx</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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" 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="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="RktStxLink" data-pltdoc="x">_</a></span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym"><a href="places.html#%28form._%28%28lib._racket%2Fplace..rkt%29._place%29%29" class="RktStxLink" data-pltdoc="x">place</a></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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">print-name</span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"~a\n"</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">name</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">print-place</span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"~a\n"</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">place</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="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym">times</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="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"Hello\n"</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="for.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%29%29" class="RktStxLink" data-pltdoc="x">for</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">i</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="sequences.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._in-range%29%29" class="RktValLink" data-pltdoc="x">in-range</a></span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktSym">times</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="RktSym">print-name</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"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="places.html#%28form._%28%28lib._racket%2Fplace..rkt%29._place%29%29" class="RktStxLink" data-pltdoc="x">place</a></span><span class="hspace"> </span><span class="RktSym">times</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="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"From\n"</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="for.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%29%29" class="RktStxLink" data-pltdoc="x">for</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">i</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="sequences.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._in-range%29%29" class="RktValLink" data-pltdoc="x">in-range</a></span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktSym">times</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="RktSym">print-place</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><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">hello</span><span class="hspace"> </span><span class="RktSym">jon</span><span class="hspace"> </span><span class="RktSym">utah</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">jon</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">Hello</span></p></td></tr><tr><td><p><span class="RktOut">jon</span></p></td></tr><tr><td><p><span class="RktOut">jon</span></p></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">utah</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">From</span></p></td></tr><tr><td><p><span class="RktOut">utah</span></p></td></tr><tr><td><p><span class="RktOut">utah</span></p></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-syntax%29%29" class="RktStxLink" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">math</span><span class="hspace"> </span><span class="RktSym">stx</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="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">make+1</span><span class="hspace"> </span><span class="RktSym">expression</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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">e</span><span class="hspace"> </span><span class="RktSym">expression</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktSym">e</span><span class="hspace"> </span><span class="RktVal">1</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"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" 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="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="RktStxLink" data-pltdoc="x">_</a></span><span class="hspace"> </span><span class="RktSym">numbers</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">added</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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="pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">make+1</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-~3elist%29%29" class="RktValLink" data-pltdoc="x">syntax->list</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">numbers</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"got ~a\n"</span><span class="hspace"> </span><span class="RktSym">added</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></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><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">math</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">9</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">got 4</span></p></td></tr><tr><td><p><span class="RktOut">got 2</span></p></td></tr><tr><td><p><span class="RktOut">got 5</span></p></td></tr><tr><td><p><span class="RktOut">got 2</span></p></td></tr><tr><td><p><span class="RktOut">got 6</span></p></td></tr><tr><td><p><span class="RktOut">got 10</span></p></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr></table></blockquote></td></tr></table></p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax</a></span></span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="stt"> </span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="specgrammar"><tr><td align="right" valign="baseline"><span class="RktVar">template</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">id</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">template</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#&</span><span class="RktVar">template</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">stat-template</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">const</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">template-elem</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">template</span><span class="hspace"> </span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktMeta">...</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">stat-template</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">id</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">stat-template</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">stat-template</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">stat-template</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">stat-template</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#&</span><span class="RktVar">stat-template</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">stat-template</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">const</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">ellipsis</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a syntax object based on a <span class="RktVar">template</span>, which can
include <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variables</span></a> bound by <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> or
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span>.</div></p><p>Template forms produce a syntax object as follows:</p><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktVar">id</span></td></tr></table></blockquote><p>If <span class="RktVar">id</span> is bound as a <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a>, then
<span class="RktVar">id</span> as a template produces the <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a>’s
match result. Unless the <span class="RktVar">id</span> is a sub-<span class="RktVar">template</span> that is
replicated by <span class="RktVar">ellipsis</span> in a larger <span class="RktVar">template</span>, the
<a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a>’s value must be a syntax object with a
<a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth marker</span></a> of <span style="font-style: italic"></span>0<span style="font-style: italic"></span> (as opposed to a list of
matches).</p><p>More generally, if the <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a>’s value has a depth
marker <span style="font-style: italic">n</span>, then it can only appear within a template where it
is replicated by at least <span style="font-style: italic">n</span> <span class="RktVar">ellipsis</span>es. In that case,
the template will be replicated enough times to use each match result
at least once.</p><p>If <span class="RktVar">id</span> is not bound as a pattern variable, then <span class="RktVar">id</span>
as a template produces <span class="RktPn">(</span><span class="RktSym"><a href="Syntax_Quoting__quote-syntax.html#%28form._%28%28quote._~23~25kernel%29._quote-syntax%29%29" class="RktStxLink" data-pltdoc="x">quote-syntax</a></span><span class="stt"> </span><span class="RktVar">id</span><span class="RktPn">)</span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Produces a syntax object whose datum is a list, and where the
elements of the list correspond to syntax objects produced by the
<span class="RktVar">template-elem</span>s.</p><p>A <span class="RktVar">template-elem</span> is a sub-<span class="RktVar">template</span> replicated by any
number of <span class="RktVar">ellipsis</span>es:</p><ul><li><p>If the sub-<span class="RktVar">template</span> is replicated by no
<span class="RktVar">ellipsis</span>es, then it generates a single syntax object to
incorporate into the result syntax object.</p></li><li><p>If the sub-<span class="RktVar">template</span> is replicated by one
<span class="RktVar">ellipsis</span>, then it generates a sequence of syntax objects
that is “inlined” into the resulting syntax object.</p><p>The number of generated elements depends on the values of
<a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variables</span></a> referenced within the
sub-<span class="RktVar">template</span>. There must be at least one <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern
variable</span></a> whose value has a <a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth marker</span></a> less than the
number of <span class="RktVar">ellipsis</span>es after the pattern variable within the
sub-<span class="RktVar">template</span>.</p><p>If a <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a> is replicated by more
<span class="RktVar">ellipsis</span>es in a <span class="RktVar">template</span> than the <a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth
marker</span></a> of its binding, then the <a href="#%28tech._pattern._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">pattern variable</span></a>’s result
is determined normally for inner <span class="RktVar">ellipsis</span>es (up to the
binding’s <a href="#%28tech._depth._marker%29" class="techoutside" data-pltdoc="x"><span class="techinside">depth marker</span></a>), and then the result is replicated
as necessary to satisfy outer <span class="RktVar">ellipsis</span>es.</p></li><li><p>For each <span class="RktVar">ellipsis</span> after the first one, the preceding
element (with earlier replicating <span class="RktVar">ellipsis</span>es) is
conceptually wrapped with parentheses for generating output, and
then the wrapping parentheses are removed in the resulting syntax
object.</p></li></ul></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">template</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like the previous form, but the result is not necessarily a list;
instead, the place of the empty list in the resulting syntax object’s
datum is taken by the syntax object produced by <span class="RktVar">template</span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#</span><span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like the <span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> form, but producing a syntax
object whose datum is a vector instead of a list.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#&</span><span class="RktVar">template</span></td></tr></table></blockquote><p>Produces a syntax object whose datum is a box holding the
syntax object produced by <span class="RktVar">template</span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="stt">#s</span><span class="RktPn">(</span><span class="RktVar">key-datum</span><span class="hspace"> </span><span class="RktVar">template-elem</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Like the <span class="RktPn">(</span><span class="RktVar">template-elem</span><span class="stt"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span> form, but producing a syntax
object whose datum is a <a href="structures.html#%28tech._prefab%29" class="techoutside" data-pltdoc="x"><span class="techinside">prefab</span></a> structure instead of a list.
The <span class="RktVar">key-datum</span> must correspond to a valid first argument of
<span class="RktSym"><a href="structutils.html#%28def._%28%28quote._~23~25kernel%29._make-prefab-struct%29%29" class="RktValLink" data-pltdoc="x">make-prefab-struct</a></span>.</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktPn">(</span><span class="RktVar">ellipsis</span><span class="hspace"> </span><span class="RktVar">stat-template</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Produces the same result as <span class="RktVar">stat-template</span>, which is like a
<span class="RktVar">template</span>, but <span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span> is treated like an <span class="RktVar">id</span>
(with no pattern binding).</p></blockquote><blockquote class="leftindent"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><span class="RktVar">const</span></td></tr></table></blockquote><p>A <span class="RktVar">const</span> template is any form that does not match the
preceding cases, and it produces the result <span class="RktPn">(</span><span class="RktSym"><a href="Syntax_Quoting__quote-syntax.html#%28form._%28%28quote._~23~25kernel%29._quote-syntax%29%29" class="RktStxLink" data-pltdoc="x">quote-syntax</a></span><span class="stt"> </span><span class="RktVar">const</span><span class="RktPn">)</span>.</p></blockquote><p>A <span class="RktPn">(</span><span class="RktKw">syntax</span><span class="stt"> </span><span class="RktVar">template</span><span class="RktPn">)</span> form is normally
abbreviated as <span class="RktRdr">#'</span><span class="RktVar">template</span>; see also
<a href="reader.html#%28part._parse-quote%29" data-pltdoc="x">Reading Quotes</a>. If <span class="RktVar">template</span> contains no pattern
variables, then <span class="RktRdr">#'</span><span class="RktVar">template</span> is equivalent to
<span class="RktPn">(</span><span class="RktSym"><a href="Syntax_Quoting__quote-syntax.html#%28form._%28%28quote._~23~25kernel%29._quote-syntax%29%29" class="RktStxLink" data-pltdoc="x">quote-syntax</a></span><span class="stt"> </span><span class="RktVar">template</span><span class="RktPn">)</span>.</p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/qqstx..rkt)._quasisyntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">quasisyntax</a></span></span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxLink" data-pltdoc="x">syntax</a></span>, but <span class="RktPn">(</span><span class="RktKw">unsyntax</span><span class="stt"> </span><span class="RktVar">expr</span><span class="RktPn">)</span> and <span class="RktPn">(</span><span class="RktKw">unsyntax-splicing</span><span class="stt"> </span><span class="RktVar">expr</span><span class="RktPn">)</span>
escape to an expression within the <span class="RktVar">template</span>.</div></p><p>The <span class="RktVar">expr</span> must produce a syntax object (or syntax list) to be
substituted in place of the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax%29%29" class="RktStxLink" data-pltdoc="x">unsyntax</a></span> or
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax-splicing%29%29" class="RktStxLink" data-pltdoc="x">unsyntax-splicing</a></span> form within the quasiquoting template, just
like <span class="RktSym"><a href="quasiquote.html#%28form._%28%28quote._~23~25kernel%29._unquote%29%29" class="RktStxLink" data-pltdoc="x">unquote</a></span> and <span class="RktSym"><a href="quasiquote.html#%28form._%28%28quote._~23~25kernel%29._unquote-splicing%29%29" class="RktStxLink" data-pltdoc="x">unquote-splicing</a></span> within
<span class="RktSym"><a href="quasiquote.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._quasiquote%29%29" class="RktStxLink" data-pltdoc="x">quasiquote</a></span>. (If the escaped expression does not generate a
syntax object, it is converted to one in the same way as for the
right-hand side of <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._with-syntax%29%29" class="RktStxLink" data-pltdoc="x">with-syntax</a></span>.) Nested
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxLink" data-pltdoc="x">quasisyntax</a></span>es introduce quasiquoting layers in the same way
as nested <span class="RktSym"><a href="quasiquote.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._quasiquote%29%29" class="RktStxLink" data-pltdoc="x">quasiquote</a></span>s.</p><p>Also analogous to <span class="RktSym"><a href="quasiquote.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._quasiquote%29%29" class="RktStxLink" data-pltdoc="x">quasiquote</a></span>, the reader converts <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#`</span><span class="hspace"></span></span>
to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxLink" data-pltdoc="x">quasisyntax</a></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#,</span><span class="hspace"></span></span> to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax%29%29" class="RktStxLink" data-pltdoc="x">unsyntax</a></span>, and
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">#,@</span><span class="hspace"></span></span> to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax-splicing%29%29" class="RktStxLink" data-pltdoc="x">unsyntax-splicing</a></span>. See also
<a href="reader.html#%28part._parse-quote%29" data-pltdoc="x">Reading Quotes</a>.</p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/qqstx..rkt)._unsyntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">unsyntax</a></span></span><span class="hspace"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Illegal as an expression form. The <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax%29%29" class="RktStxLink" data-pltdoc="x">unsyntax</a></span> form is for use
only with a <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxLink" data-pltdoc="x">quasisyntax</a></span> template.</div></p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/qqstx..rkt)._unsyntax-splicing))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax-splicing%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">unsyntax-splicing</a></span></span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Illegal as an expression form. The <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._unsyntax-splicing%29%29" class="RktStxLink" data-pltdoc="x">unsyntax-splicing</a></span> form is
for use only with a <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxLink" data-pltdoc="x">quasisyntax</a></span> template.</div></p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax/loc))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%2Floc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax/loc</a></span></span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxLink" data-pltdoc="x">syntax</a></span>, except that the immediate resulting syntax
object takes its source-location information from the result of
<span class="RktVar">stx-expr</span> (which must produce a syntax object), unless the
<span class="RktVar">template</span> is just a pattern variable, or both the source and
position of <span class="RktVar">stx-expr</span> are <span class="RktVal">#f</span>.</div></p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/qqstx..rkt)._quasisyntax/loc))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%2Floc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">quasisyntax/loc</a></span></span><span class="hspace"> </span><span class="RktVar">stx-expr</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fqqstx..rkt%29._quasisyntax%29%29" class="RktStxLink" data-pltdoc="x">quasisyntax</a></span>, but with source-location assignment like
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%2Floc%29%29" class="RktStxLink" data-pltdoc="x">syntax/loc</a></span>.</div></p><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._quote-syntax/prune))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._quote-syntax%2Fprune%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">quote-syntax/prune</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="Syntax_Quoting__quote-syntax.html#%28form._%28%28quote._~23~25kernel%29._quote-syntax%29%29" class="RktStxLink" data-pltdoc="x">quote-syntax</a></span>, but the lexical context of <span class="RktVar">id</span> is
pruned via <span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._identifier-prune-lexical-context%29%29" class="RktValLink" data-pltdoc="x">identifier-prune-lexical-context</a></span> to including
binding only for the symbolic name of <span class="RktVar">id</span> and for
<span class="RktVal">'</span><span class="RktVal">#%top</span>. Use this form to quote an identifier when its lexical
information will not be transferred to other syntax objects (except
maybe to <span class="RktVal">'</span><span class="RktVal">#%top</span> for a top-level binding).</div></p><p><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>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax-rules))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-rules%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax-rules</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Equivalent to</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" 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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" 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="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">generated-id</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stxcerts.html#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-protect%29%29" class="RktValLink" data-pltdoc="x">syntax-protect</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktVar">template</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>where each <span class="RktVar">generated-id</span> binds no identifier in the
corresponding <span class="RktVar">template</span>.</p><p><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>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._syntax-id-rules))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-id-rules%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax-id-rules</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Equivalent to</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-set%21-transformer%29%29" class="RktValLink" data-pltdoc="x">make-set!-transformer</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" 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="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" 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="RktVar">literal-id</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stxcerts.html#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-protect%29%29" class="RktValLink" data-pltdoc="x">syntax-protect</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktVar">template</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/misc..rkt)._define-syntax-rule))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._define-syntax-rule%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-syntax-rule</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Equivalent to</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-syntax%29%29" class="RktStxLink" data-pltdoc="x">define-syntax</a></span><span class="hspace"> </span><span class="RktVar">id</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-rules%29%29" class="RktStxLink" data-pltdoc="x">syntax-rules</a></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="RktVar">id</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">template</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>but with syntax errors potentially phrased in terms of
<span class="RktVar">pattern</span>.</p><p><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>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._racket/private/stxcase-scheme..rkt)._......))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">...</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span> transformer binding prohibits <span class="RktMeta"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span> from
being used as an expression. This binding is useful only in syntax
patterns and templates, where it indicates repetitions of a pattern or
template. See <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> and <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxLink" data-pltdoc="x">syntax</a></span>.</div></p><p><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>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._racket/private/stxcase-scheme..rkt).__))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">_</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="RktStxLink" data-pltdoc="x">_</a></span> transformer binding prohibits <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29.__%29%29" class="RktStxLink" data-pltdoc="x">_</a></span> from being
used as an expression. This binding is useful only in syntax patterns,
where it indicates a pattern that matches any syntax object. See
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span>.</div></p><p><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._racket/private/stxcase-scheme..rkt)._syntax-pattern-variable~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-pattern-variable~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">syntax-pattern-variable?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a value that, as a
transformer-binding value, makes the bound variable as pattern
variable in <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax%29%29" class="RktStxLink" data-pltdoc="x">syntax</a></span> and other forms. To check whether an
identifier is a pattern variable, use <span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._syntax-local-value%29%29" class="RktValLink" data-pltdoc="x">syntax-local-value</a></span> to
get the identifier’s transformer value, and then test the value with
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-pattern-variable~3f%29%29" class="RktValLink" data-pltdoc="x">syntax-pattern-variable?</a></span>.</div></p><p>The <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-pattern-variable~3f%29%29" class="RktValLink" data-pltdoc="x">syntax-pattern-variable?</a></span> procedure is provided
<span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-syntax%29%29" class="RktStxLink" data-pltdoc="x">for-syntax</a></span> by <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/base</span></a>.</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.1", "../");" 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.1");">top</a></span><span class="navright"> <a href="Macros.html" title="backward to "12 Macros"" data-pltdoc="x">← prev</a> <a href="Macros.html" title="up to "12 Macros"" data-pltdoc="x">up</a> <a href="stxops.html" title="forward to "12.2 Syntax Object Content"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|