/usr/share/doc/racket/reference/stxparam.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 | <!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.5 Syntax Parameters</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="icons.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="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">12.1 </td><td><a href="stx-patterns.html" class="tocviewlink" 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="" class="tocviewselflink" 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 class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>12.5 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Syntax Parameters</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">12.5.1 </td><td><a href="#%28part._.Syntax_.Parameter_.Inspection%29" class="tocviewlink" data-pltdoc="x">Syntax Parameter Inspection</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%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>syntax-<wbr></wbr>parameter</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">syntax-<wbr></wbr>parameterize</span></span></a></td></tr><tr><td><span class="tocsublinknumber">12.5.1<tt> </tt></span><a href="#%28part._.Syntax_.Parameter_.Inspection%29" class="tocsubseclink" data-pltdoc="x">Syntax Parameter Inspection</a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">syntax-<wbr></wbr>parameter-<wbr></wbr>value</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._make-parameter-rename-transformer%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>parameter-<wbr></wbr>rename-<wbr></wbr>transformer</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="stxtrans.html" title="backward to "12.4 Syntax Transformers"" data-pltdoc="x">← prev</a> <a href="Macros.html" title="up to "12 Macros"" data-pltdoc="x">up</a> <a href="splicing.html" title="forward to "12.6 Local Binding with Splicing Body"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""stxparam"">12.5<tt> </tt><a name="(part._stxparam)"></a><a name="(mod-path._racket/stxparam)"></a>Syntax Parameters</h4><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">base</span></span></td></tr></table></div><div class="SIntrapara">The bindings documented in this section are provided by the <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam</span></a> library, not <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/base</span></a> or <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket</span></a>.</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/stxparam..rkt)._define-syntax-parameter))"></a><span title="Provided from: racket/stxparam | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Binds <span class="RktVar">id</span> as syntax to a <a name="(tech._syntax._parameter)"></a><span style="font-style: italic">syntax
parameter</span>. The <span class="RktVar">expr</span> is an expression in the
<a href="syntax-model.html#%28tech._transformer._environment%29" class="techoutside" data-pltdoc="x"><span class="techinside">transformer environment</span></a> that serves as the default value for
the <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a>. The value is typically obtained by a transformer
using <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="RktValLink" data-pltdoc="x">syntax-parameter-value</a></span>.</div></p><p>The <span class="RktVar">id</span> can be used with <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">syntax-parameterize</a></span>
or <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="RktValLink" data-pltdoc="x">syntax-parameter-value</a></span> (in a transformer). If
<span class="RktVar">expr</span> produces a procedure of one argument or a
<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> result, then <span class="RktVar">id</span> can be
used as a macro. If <span class="RktVar">expr</span> produces a
<span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-rename-transformer</a></span> result, then <span class="RktVar">id</span> can be
used as a macro that expands to a use of the target identifier, but
<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> of <span class="RktVar">id</span> does not produce
the target’s value.</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="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span><span class="hspace"> </span><span class="RktSym">current-class</span><span class="hspace"> </span><span class="RktVal">#f</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"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span><span class="hspace"> </span><span class="RktSym">yield</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-rename-transformer</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktSym">abort</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="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span><span class="hspace"> </span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</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="hspace"> </span><span class="RktPn">(</span><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><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">"use of a class keyword not in a class"</span><span class="hspace"> </span><span class="RktSym">stx</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"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin-for-syntax%29%29" class="RktStxLink" data-pltdoc="x">begin-for-syntax</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._displayln%29%29" class="RktValLink" data-pltdoc="x">displayln</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="RktValLink" data-pltdoc="x">syntax-parameter-value</a></span><span class="hspace"> </span><span class="RktRdr">#'</span><span class="RktSym">current-class</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">#f</span></p></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">yield</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</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><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/stxparam..rkt)._syntax-parameterize))"></a><span title="Provided from: racket/stxparam | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">syntax-parameterize</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body-expr</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="magnify.png" alt="+" width="24" height="24"/></span>See also <span class="RktSym"><a href="splicing.html#%28form._%28%28lib._racket%2Fsplicing..rkt%29._splicing-syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">splicing-syntax-parameterize</a></span>.</p></blockquote></blockquote></blockquote></div></p><p>Each <span class="RktVar">id</span> must be bound to a <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a> using
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span>. Each <span class="RktVar">expr</span> is an expression
in the <a href="syntax-model.html#%28tech._transformer._environment%29" class="techoutside" data-pltdoc="x"><span class="techinside">transformer environment</span></a>. During the expansion of the
<span class="RktVar">body-expr</span>s, the value of each <span class="RktVar">expr</span> is bound to the
corresponding <span class="RktVar">id</span>.</p><p>If an <span class="RktVar">expr</span> produces a procedure of one argument or a
<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> result, then its <span class="RktVar">id</span>
can be used as a macro during the expansion of the
<span class="RktVar">body-expr</span>s. If <span class="RktVar">expr</span> produces a
<span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-rename-transformer</a></span> result, then <span class="RktVar">id</span> can be
used as a macro that expands to a use of the target identifier, but
<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> of <span class="RktVar">id</span> does not produce
the target’s value.</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="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span><span class="hspace"> </span><span class="RktSym">abort</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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><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="RktSym">forever</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">forever</span><span class="hspace"> </span><span class="RktSym">body</span><span class="hspace"> </span><span class="RktMeta"><a href="stx-patterns.html#%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="cont.html#%28def._%28%28quote._~23~25kernel%29._call%2Fcc%29%29" class="RktValLink" data-pltdoc="x">call/cc</a></span><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">abort-k</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%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">syntax-parameterize</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">abort</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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">abort-k</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><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="RktSym">loop</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">body</span><span class="hspace"> </span><span class="RktMeta"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">loop</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><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"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._define-syntax-parameter%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-parameter</a></span><span class="hspace"> </span><span class="RktSym">it</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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><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="RktSym">aif</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%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="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">aif</span><span class="hspace"> </span><span class="RktSym">test</span><span class="hspace"> </span><span class="RktSym">then</span><span class="hspace"> </span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</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="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">test</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%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">syntax-parameterize</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">it</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-id-rules%29%29" class="RktStxLink" data-pltdoc="x">syntax-id-rules</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym"><a href="stx-patterns.html#%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">t</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktSym">t</span><span class="hspace"> </span><span class="RktSym">then</span><span class="hspace"> </span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></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></table></blockquote></td></tr></table></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""Syntax_Parameter_Inspection"">12.5.1<tt> </tt><a name="(part._.Syntax_.Parameter_.Inspection)"></a><a name="(mod-path._racket/stxparam-exptime)"></a>Syntax Parameter Inspection</h5><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </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="stt"> </span><a href="#%28mod-path._racket%2Fstxparam-exptime%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam-exptime</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">base</span></span></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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/stxparam-exptime..rkt)._syntax-parameter-value))"></a><span title="Provided from: racket/stxparam-exptime, racket/stxparam | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="RktValDef RktValLink" data-pltdoc="x">syntax-parameter-value</a></span></span><span class="hspace"> </span><span class="RktVar">id-stx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">id-stx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax~3f%29%29" class="RktValLink" data-pltdoc="x">syntax?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">This procedure is intended for use in a <a href="syntax-model.html#%28tech._transformer._environment%29" class="techoutside" data-pltdoc="x"><span class="techinside">transformer
environment</span></a>, where <span class="RktVar">id-stx</span> is an identifier bound in the
normal environment to a <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a>. The result is the current
value of the <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a>, as adjusted by
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">syntax-parameterize</a></span> form.</div></p><p>This binding 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="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam</span></a>, since it is normally used in a
transformer. It is provided normally by
<a href="#%28mod-path._racket%2Fstxparam-exptime%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam-exptime</span></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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/stxparam-exptime..rkt)._make-parameter-rename-transformer))"></a><span title="Provided from: racket/stxparam-exptime, racket/stxparam | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._make-parameter-rename-transformer%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-parameter-rename-transformer</a></span></span><span class="hspace"> </span><span class="RktVar">id-stx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">id-stx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax~3f%29%29" class="RktValLink" data-pltdoc="x">syntax?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">This procedure is intended for use in a transformer, where
<span class="RktVar">id-stx</span> is an identifier bound to a <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a>. The
result is a transformer that behaves as <span class="RktVar">id-stx</span>, but that cannot
be used with <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fstxparam..rkt%29._syntax-parameterize%29%29" class="RktStxLink" data-pltdoc="x">syntax-parameterize</a></span> or
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._syntax-parameter-value%29%29" class="RktValLink" data-pltdoc="x">syntax-parameter-value</a></span>.</div></p><p>Using <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._make-parameter-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-parameter-rename-transformer</a></span> is analogous to
defining a procedure that calls a parameter. Such a procedure can be
exported to others to allow access to the parameter value, but not to
change the parameter value. Similarly,
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._make-parameter-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-parameter-rename-transformer</a></span> allows a <a href="#%28tech._syntax._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax parameter</span></a>
to be used as a macro, but not changed.</p><p>The result of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fstxparam-exptime..rkt%29._make-parameter-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-parameter-rename-transformer</a></span> is not
treated specially by <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>, unlike the result
of <span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._make-rename-transformer%29%29" class="RktValLink" data-pltdoc="x">make-rename-transformer</a></span>.</p><p>This binding 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="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam</span></a>, since it is normally used in a
transformer. It is provided normally by
<a href="#%28mod-path._racket%2Fstxparam-exptime%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/stxparam-exptime</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="stxtrans.html" title="backward to "12.4 Syntax Transformers"" data-pltdoc="x">← prev</a> <a href="Macros.html" title="up to "12 Macros"" data-pltdoc="x">up</a> <a href="splicing.html" title="forward to "12.6 Local Binding with Splicing Body"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|