/usr/share/doc/racket/scribble/srcdoc.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 | <!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>4.6 In-Source Documentation</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Scribble:<span class="mywbr"> </span> The Racket Documentation Tool</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="getting-started.html" class="tocviewlink" data-pltdoc="x">Getting Started</a></td></tr><tr><td align="right">2 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">@ Syntax</a></td></tr><tr><td align="right">3 </td><td><a href="generic-prose.html" class="tocviewlink" data-pltdoc="x">High-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">4 </td><td><a href="plt-manuals.html" class="tocviewselflink" data-pltdoc="x">Scribbling Documentation</a></td></tr><tr><td align="right">5 </td><td><a href="lp.html" class="tocviewlink" data-pltdoc="x">Literate Programming</a></td></tr><tr><td align="right">6 </td><td><a href="internals.html" class="tocviewlink" data-pltdoc="x">Low-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">7 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running <span class="stt">scribble</span></a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>4 </td><td><a href="plt-manuals.html" class="tocviewlink" data-pltdoc="x">Scribbling Documentation</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.1 </td><td><a href="how-to-doc.html" class="tocviewlink" data-pltdoc="x">Getting Started with Documentation</a></td></tr><tr><td align="right">4.2 </td><td><a href="reference-style.html" class="tocviewlink" data-pltdoc="x">Style Guide</a></td></tr><tr><td align="right">4.3 </td><td><a href="manual.html" class="tocviewlink" data-pltdoc="x">Manual Forms</a></td></tr><tr><td align="right">4.4 </td><td><a href="scheme.html" class="tocviewlink" data-pltdoc="x">Racket</a></td></tr><tr><td align="right">4.5 </td><td><a href="eval.html" class="tocviewlink" data-pltdoc="x">Evaluation and Examples</a></td></tr><tr><td align="right">4.6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">In-<wbr></wbr>Source Documentation</a></td></tr><tr><td align="right">4.7 </td><td><a href="bnf.html" class="tocviewlink" data-pltdoc="x">BNF Grammars</a></td></tr><tr><td align="right">4.8 </td><td><a href="Compatibility_Libraries.html" class="tocviewlink" data-pltdoc="x">Compatibility Libraries</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>4.6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">In-<wbr></wbr>Source Documentation</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.6.1 </td><td><a href="#%28part._.Source_.Annotations_for_.Documentation%29" class="tocviewlink" data-pltdoc="x">Source Annotations for Documentation</a></td></tr><tr><td align="right">4.6.2 </td><td><a href="#%28part._.Extracting_.Documentation_from_.Source%29" class="tocviewlink" data-pltdoc="x">Extracting Documentation from Source</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">4.6.1<tt> </tt></span><a href="#%28part._.Source_.Annotations_for_.Documentation%29" class="tocsubseclink" data-pltdoc="x">Source Annotations for Documentation</a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">for-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%2Fnames%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">proc-<wbr></wbr>doc/<span class="mywbr"> </span>names</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">proc-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._thing-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">thing-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._parameter-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">parameter-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._struct%2A-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">struct*-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._struct-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">struct-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._begin-for-doc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">begin-<wbr></wbr>for-<wbr></wbr>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._generate-delayed-documents%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">generate-<wbr></wbr>delayed-<wbr></wbr>documents</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._require%2Fdoc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">require/<span class="mywbr"> </span>doc</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._provide%2Fdoc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">provide/<span class="mywbr"> </span>doc</span></span></a></td></tr><tr><td><span class="tocsublinknumber">4.6.2<tt> </tt></span><a href="#%28part._.Extracting_.Documentation_from_.Source%29" class="tocsubseclink" data-pltdoc="x">Extracting Documentation from Source</a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-extracted%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">include-<wbr></wbr>extracted</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._provide-extracted%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">provide-<wbr></wbr>extracted</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-previously-extracted%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">include-<wbr></wbr>previously-<wbr></wbr>extracted</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="eval.html" title="backward to "4.5 Evaluation and Examples"" data-pltdoc="x">← prev</a> <a href="plt-manuals.html" title="up to "4 Scribbling Documentation"" data-pltdoc="x">up</a> <a href="bnf.html" title="forward to "4.7 BNF Grammars"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""srcdoc"">4.6<tt> </tt><a name="(part._srcdoc)"></a>In-Source Documentation</h4><p>The <a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a> and
<a href="#%28mod-path._scribble%2Fextract%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/extract</span></a> libraries support writing
documentation within the documented code along with an export
contract, similar to using <a name="(idx._(gentag._11._(lib._scribblings/scribble/scribble..scrbl)))"></a>JavaDoc. With this approach, a
single contract specification is used both for the run-time contract
and the documentation of an exported binding.</p><p>The <a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a> library provides forms for
exporting a binding with associated documentation. The
<span class="RktSym">scribble/extract</span> library is used to pull
<span class="RktSym">scribble/srcdoc</span>-based documentation into a Scribble document
(perhaps for multiple libraries).</p><p>Although documentation is written with a library’s implementation when
using <a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a>, the documentation creates no
run-time overhead for the library. Similarly, typesetting the
documentation does not require running the library. The two phases
(run time versus documentation time) are kept separate in much the
same way that the module system keeps expansion-time code separate
from run-time code, and documentation information is recorded in a
submodule to be separately loadable from the enclosing module.</p><p>For an example use, see the <span class="stt">"file"</span> collection’s
<span class="stt">"gif.rkt"</span> source file and the corresponding extraction in
<span class="stt">"scribblings/gif.scrbl"</span>. As that example illustrates,
starting the module declaration with</p><blockquote class="SCodeFlow"><p><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="reader-internals.html#%28mod-path._at-exp%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">at-exp</span></a></p></blockquote><p>enables the @-reader, which is handy for writing documentation
expressions.</p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Source_Annotations_for_Documentation"">4.6.1<tt> </tt><a name="(part._.Source_.Annotations_for_.Documentation)"></a><a name="(mod-path._scribble/srcdoc)"></a>Source Annotations for Documentation</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="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">scribble-lib</span></span></td></tr></table></p><p>Documentation information generated by <a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a>
forms are accumulated into a <span class="RktSym">srcdoc</span> submodule. The
generated submodule is accessed by the bindings of
<a href="#%28mod-path._scribble%2Fextract%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/extract</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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._scribble/srcdoc..rkt)._for-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">for-doc</a></span></span><span class="hspace"> </span><span class="RktVar">require-spec</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span> sub-form for bindings that are needed at
documentation time (and documentation-expansion time, etc.) instead of
run time (and expansion time, etc.). A <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span> import has
no effect on a normal use of the library; it affects only
documentation extraction.</div></p><p>Typically, a library that uses <a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a>
includes at least <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span><span class="stt"> </span><span class="RktSym">scribble/base</span><span class="stt"> </span><span class="RktSym">scribble/manual</span><span class="RktPn">)</span><span class="RktPn">)</span>
to get core Racket forms and basic Scribble functions to use in
documentation expressions.</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._scribble/srcdoc..rkt)._proc-doc/names))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%2Fnames%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">proc-doc/names</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktVar">arg-specs</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">desc-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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">arg-specs</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="RktPn">(</span><span class="RktVar">arg-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktVar">arg-id</span><span class="hspace"> </span><span class="RktVar">default-expr</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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">arg-id</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"><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">contract</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">result</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%252A%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">mandatory</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">optional</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">result</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._case-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">case-></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">result</span><span class="RktPn">)</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"><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">mandatory</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">contract-expr</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">keyword</span><span class="hspace"> </span><span class="RktVar">contract-expr</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">optional</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">contract-expr</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">keyword</span><span class="hspace"> </span><span class="RktVar">contract-expr</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._provide%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">provide</a></span> sub-form that exports <span class="RktVar">id</span> with the
contract described by <span class="RktVar">contract</span>
just like using <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=attaching-contracts-to-values.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._contract-out%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">contract-out</a></span>.</div></p><p>The <span class="RktSym">arg-spec</span> specifies the names of arguments and the
default values, which are not
normally written as part of a contract. They are combined with the
contract expression to generate the description of the binding in the
documentation via <span class="RktSym"><a href="doc-forms.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defproc%29%29" class="RktStxLink" data-pltdoc="x">defproc</a></span>. The <span class="RktPn">(</span><span class="RktVar">arg-id</span><span class="stt"> </span><span class="RktVar">default-expr</span><span class="RktPn">)</span>
pairs specify the names and default values of the optional arguments.
If the contract supports optional arguments, then the first
<span class="RktSym">arg-spec</span>s form must be used, otherwise the second must be used.</p><p>The <span class="RktVar">desc-expr</span> is a sequence of documentation-time expressions that
produces prose to describe the exported binding—<wbr></wbr>that is, the last
part of the generated <span class="RktSym"><a href="doc-forms.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defproc%29%29" class="RktStxLink" data-pltdoc="x">defproc</a></span>, so the description can refer
to the <span class="RktVar">arg-id</span>s using <span class="RktSym"><a href="scribble_manual_code.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._racket%29%29" class="RktStxLink" data-pltdoc="x">racket</a></span>.</p><p>The normal <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span>s of the enclosing library are effectively
converted into <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._for-label%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">for-label</a></span> <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span>s when generating
documentation, so that identifiers in the <span class="RktVar">contract</span>s are
linked to their corresponding documentation. Similarly, any binding
that is available in the run-time phase of the enclosing library
can be referenced in documentation prose using the <span class="RktSym"><a href="scribble_manual_code.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._racket%29%29" class="RktStxLink" data-pltdoc="x">racket</a></span>
form.</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._scribble/srcdoc..rkt)._proc-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">proc-doc</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktVar">maybe-defs</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">desc-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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">contract</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVar">result</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ei%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>i</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">opt</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">maybe-pre</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">res</span><span class="RktPn">]</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ei%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>i</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">opt</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">maybe-pre</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=values.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._values%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">values</a></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">res</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ei%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>i</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">opt</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktVar">rest</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">result-expr</span><span class="RktPn">]</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ed%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>d</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">maybe-pre</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=values.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._values%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">values</a></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">result</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ed%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>d</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">maybe-pre</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">result</span><span class="RktPn">]</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="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ed%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>d</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">arg</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">rest</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">result</span><span class="RktPn">]</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">maybe-pre</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"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td></td></tr></table></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">#:pre</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">pre-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">condition</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">maybe-defs</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"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td></td></tr></table></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">default-expr</span><span class="hspace"> </span><span class="RktVar">default-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%2Fnames%29%29" class="RktStxLink" data-pltdoc="x">proc-doc/names</a></span>, but supporting contract forms that embed
argument identifiers. Only a subset of <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ei%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>i</a></span> and <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3ed%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>d</a></span> forms are
currently supported.</div></p><p>If the sequence of optional arguments, <span class="RktPn">(</span><span class="RktVar">opt</span><span class="stt"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span> is empty then
the <span class="RktSym">maybe-arg-desc</span> must be not be present. If it is non-empty,
then it must have as many default expressions are there are optional
arguments.</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._scribble/srcdoc..rkt)._thing-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._thing-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">thing-doc</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">contract-expr</span><span class="hspace"> </span><span class="RktVar">dec-expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%29%29" class="RktStxLink" data-pltdoc="x">proc-doc</a></span>, but for an export of an arbitrary value.</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._scribble/srcdoc..rkt)._parameter-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._parameter-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">parameter-doc</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._parameter%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">parameter/c</a></span><span class="hspace"> </span><span class="RktVar">contract-expr</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">arg-id</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">desc-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%29%29" class="RktStxLink" data-pltdoc="x">proc-doc</a></span>, but for exporting a parameter.</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._scribble/srcdoc..rkt)._struct*-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._struct%2A-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">struct*-doc</a></span></span><span class="hspace"> </span><span class="RktVar">struct-name</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">field-name</span><span class="hspace"> </span><span class="RktVar">contract-expr-datum</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">maybe-omit-constructor</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">maybe-mutable</span><span class="hspace"> </span><span class="RktVar">maybe-non-opaque</span><span class="hspace"> </span><span class="RktVar">maybe-constructor</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">desc-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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">maybe-omit-constructor</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"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td></td></tr></table></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">#:omit-constructor</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%29%29" class="RktStxLink" data-pltdoc="x">proc-doc</a></span>, but for struct declarations that use <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">struct</a></span>.</div></p><p>The <span class="RktVar">maybe-mutable</span>, <span class="RktVar">maybe-non-opaque</span>, and <span class="RktVar">maybe-constructor</span>
options are as in <span class="RktSym"><a href="doc-forms.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defstruct%29%29" class="RktStxLink" data-pltdoc="x">defstruct</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._scribble/srcdoc..rkt)._struct-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._struct-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">struct-doc</a></span></span><span class="hspace"> </span><span class="RktVar">struct-name</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">field-name</span><span class="hspace"> </span><span class="RktVar">contract-expr-datum</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">maybe-omit-constructor</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">maybe-mutable</span><span class="hspace"> </span><span class="RktVar">maybe-non-opaque</span><span class="hspace"> </span><span class="RktVar">maybe-constructor</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">desc-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</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._scribble%2Fsrcdoc..rkt%29._struct%2A-doc%29%29" class="RktStxLink" data-pltdoc="x">struct*-doc</a></span>, but for struct declarations that use <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define-struct%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">define-struct</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._scribble/srcdoc..rkt)._begin-for-doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._begin-for-doc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">begin-for-doc</a></span></span><span class="hspace"> </span><span class="RktVar">form</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=begin.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._begin-for-syntax%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">begin-for-syntax</a></span>, but for documentation time instead
of expansion time. The <span class="RktVar">form</span>s can refer to binding
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span>d with <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span>.</div></p><p>For example, a definition in <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._begin-for-doc%29%29" class="RktStxLink" data-pltdoc="x">begin-for-doc</a></span>
can be referenced by a <span class="RktVar">desc-expr</span> in
<span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._proc-doc%2Fnames%29%29" class="RktStxLink" data-pltdoc="x">proc-doc/names</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><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._scribble/srcdoc..rkt)._generate-delayed-documents))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._generate-delayed-documents%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">generate-delayed-documents</a></span></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Causes documentation information to be recorded as a macro that is
expanded (along with any <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span> imports) in the
module that uses <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-extracted</a></span> or <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._provide-extracted%29%29" class="RktStxLink" data-pltdoc="x">provide-extracted</a></span>,
instead of within (a submodule of) the module that declares the information.</div></p><p>Delaying document generation in this way allows <span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._for-label%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">for-label</a></span><span class="stt"> </span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span> imports that would otherwise create cyclic module
dependencies.</p><p>To avoid problems with accumulated <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span> imports across
modules, <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._generate-delayed-documents%29%29" class="RktStxLink" data-pltdoc="x">generate-delayed-documents</a></span> declaration should appear
before any <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span> import.</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._scribble/srcdoc..rkt)._require/doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._require%2Fdoc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">require/doc</a></span></span><span class="hspace"> </span><span class="RktVar">require-spec</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A legacy shorthand for <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._for-doc%29%29" class="RktStxLink" data-pltdoc="x">for-doc</a></span><span class="stt"> </span><span class="RktVar">require-spec</span><span class="stt"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</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._scribble/srcdoc..rkt)._provide/doc))"></a><span title="Provided from: scribble/srcdoc | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fsrcdoc..rkt%29._provide%2Fdoc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">provide/doc</a></span></span><span class="hspace"> </span><span class="RktVar">spec</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A legacy alternative to <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._provide%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">provide</a></span><span class="stt"> </span><span class="RktVar">spec</span><span class="stt"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span></div></p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Extracting_Documentation_from_Source"">4.6.2<tt> </tt><a name="(part._.Extracting_.Documentation_from_.Source)"></a><a name="(mod-path._scribble/extract)"></a>Extracting Documentation from Source</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="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._scribble%2Fextract%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/extract</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">scribble-lib</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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._scribble/extract..rkt)._include-extracted))"></a><span title="Provided from: scribble/extract | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-extracted%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">include-extracted</a></span></span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Expands to a sequence of documentation forms extracted from
<span class="RktVar">module-path</span>, which is expected to be a module that uses
<a href="#%28mod-path._scribble%2Fsrcdoc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/srcdoc</span></a> (so that the module has a
<span class="RktSym">srcdoc</span> submodule).</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._scribble/extract..rkt)._provide-extracted))"></a><span title="Provided from: scribble/extract | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._provide-extracted%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">provide-extracted</a></span></span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-extracted</a></span>, but the documentation is
packaged and exported as <span class="RktSym">exported</span>, instead of left
inline.</div></p><p>Use this form in combination with
<span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-previously-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-previously-extracted</a></span> when documentation from a single
source is to be split and typeset among multiple documentation
locations. The <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._provide-extracted%29%29" class="RktStxLink" data-pltdoc="x">provide-extracted</a></span> form extracts the
documentation once, and then <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-previously-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-previously-extracted</a></span>
form extracts documentation for specific bindings as needed.</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._scribble/extract..rkt)._include-previously-extracted))"></a><span title="Provided from: scribble/extract | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-previously-extracted%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">include-previously-extracted</a></span></span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="hspace"> </span><span class="RktVar">regexp</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-extracted</a></span>, but instead of referring to the
source that contains its own documentation, <span class="RktVar">module-path</span>
refers to a module that uses <span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._provide-extracted%29%29" class="RktStxLink" data-pltdoc="x">provide-extracted</a></span>. The
<span class="RktSym"><a href="#%28form._%28%28lib._scribble%2Fextract..rkt%29._include-previously-extracted%29%29" class="RktStxLink" data-pltdoc="x">include-previously-extracted</a></span> form expands to documentation
forms for all identifiers whose string forms match <span class="RktVar">regexp</span>.</div></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="eval.html" title="backward to "4.5 Evaluation and Examples"" data-pltdoc="x">← prev</a> <a href="plt-manuals.html" title="up to "4 Scribbling Documentation"" data-pltdoc="x">up</a> <a href="bnf.html" title="forward to "4.7 BNF Grammars"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|