/usr/share/doc/racket/reference/data-structure-contracts.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | <!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>8.1 Data-structure Contracts</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewselflink" 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="tocviewlink" 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>8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">8.1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Data-<wbr></wbr>structure Contracts</a></td></tr><tr><td align="right">8.2 </td><td><a href="function-contracts.html" class="tocviewlink" data-pltdoc="x">Function Contracts</a></td></tr><tr><td align="right">8.3 </td><td><a href="parametric-contracts.html" class="tocviewlink" data-pltdoc="x">Parametric Contracts</a></td></tr><tr><td align="right">8.4 </td><td><a href="Lazy_Data-structure_Contracts.html" class="tocviewlink" data-pltdoc="x">Lazy Data-<wbr></wbr>structure Contracts</a></td></tr><tr><td align="right">8.5 </td><td><a href="Structure_Type_Property_Contracts.html" class="tocviewlink" data-pltdoc="x">Structure Type Property Contracts</a></td></tr><tr><td align="right">8.6 </td><td><a href="attaching-contracts-to-values.html" class="tocviewlink" data-pltdoc="x">Attaching Contracts to Values</a></td></tr><tr><td align="right">8.7 </td><td><a href="Building_New_Contract_Combinators.html" class="tocviewlink" data-pltdoc="x">Building New Contract Combinators</a></td></tr><tr><td align="right">8.8 </td><td><a href="contract-utilities.html" class="tocviewlink" data-pltdoc="x">Contract Utilities</a></td></tr><tr><td align="right">8.9 </td><td><a href="racket_contract_base.html" class="tocviewlink" data-pltdoc="x"><span class="RktModLink"><span class="RktSym">racket/<span class="mywbr"> </span>contract/<span class="mywbr"> </span>base</span></span></a></td></tr><tr><td align="right">8.10 </td><td><a href="Legacy_Contracts.html" class="tocviewlink" data-pltdoc="x">Legacy Contracts</a></td></tr><tr><td align="right">8.11 </td><td><a href="Random_generation.html" class="tocviewlink" data-pltdoc="x">Random generation</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="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-named-contract%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">flat-<wbr></wbr>named-<wbr></wbr>contract</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">any/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._none%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">none/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">or/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">and/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">not/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3d%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">=/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink"></<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3e%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">>/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c~3d%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink"><=/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3e~3d%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">>=/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._between%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">between/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._real-in%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">real-<wbr></wbr>in</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._integer-in%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">integer-<wbr></wbr>in</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._natural-number%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">natural-<wbr></wbr>number/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._string-len%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>len/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._false%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">false/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._printable%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">printable/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._one-of%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">one-<wbr></wbr>of/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._symbols%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">symbols</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vectorof</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector-immutableof%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>immutableof</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector-immutable%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>immutable/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">box/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box-immutable%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">box-<wbr></wbr>immutable/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">listof</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._non-empty-listof%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">non-<wbr></wbr>empty-<wbr></wbr>listof</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._cons%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cons/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._list%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._syntax%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">syntax/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">struct/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fdc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">struct/<span class="mywbr"> </span>dc</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">parameter/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._procedure-arity-includes%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">procedure-<wbr></wbr>arity-<wbr></wbr>includes/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._channel%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">channel/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._prompt-tag%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">prompt-<wbr></wbr>tag/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._continuation-mark-key%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">continuation-<wbr></wbr>mark-<wbr></wbr>key/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._evt%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">evt/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._flat-rec-contract%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">flat-<wbr></wbr>rec-<wbr></wbr>contract</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-murec-contract%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">flat-<wbr></wbr>murec-<wbr></wbr>contract</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">any</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._promise%2Fc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">promise/<span class="mywbr"> </span>c</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">flat-<wbr></wbr>contract</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract-predicate%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">flat-<wbr></wbr>contract-<wbr></wbr>predicate</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="contracts.html" title="backward to "8 Contracts"" data-pltdoc="x">← prev</a> <a href="contracts.html" title="up to "8 Contracts"" data-pltdoc="x">up</a> <a href="function-contracts.html" title="forward to "8.2 Function Contracts"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""data-structure-contracts"">8.1<tt> </tt><a name="(part._data-structure-contracts)"></a>Data-structure Contracts</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._flat-named-contract))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-named-contract%29%29" class="RktValDef RktValLink" data-pltdoc="x">flat-named-contract</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">type-name</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">predicate</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">generator</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">type-name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">predicate</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">generator</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fbase..rkt%29._contract%29%29" class="RktStxLink" data-pltdoc="x">contract</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym">int?</span><span class="hspace"> </span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">On predicates, behaves like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract%29%29" class="RktValLink" data-pltdoc="x">flat-contract</a></span>, but the first argument must be the
(quoted) name of a contract used for error reporting.
For example,
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-named-contract%29%29" class="RktValLink" data-pltdoc="x">flat-named-contract</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">odd-integer</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._odd~3f%29%29" class="RktValLink" data-pltdoc="x">odd?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">turns the predicate into a contract with the name <span class="stt">odd-integer</span>.</div></p><p>On flat contracts, the new flat contract is the same as the old except for
the name.</p><p>The generator argument adds a generator for the flat-named-contract. See
<span class="RktSym">contract-generate</span> for more information.</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>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/contract/private/misc..rkt)._any/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">any/c</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A flat contract that accepts any value.</div></p><p>When using this contract as the result portion of a function contract,
consider using <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span> instead; using <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span> leads to
better memory performance, but it also allows multiple results.</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>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/contract/private/misc..rkt)._none/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._none%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">none/c</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contract</span></a> that accepts no values.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/base..rkt)._or/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">or/c</a></span></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Takes any number of contracts and returns
a contract that accepts any value that any one of the contracts
accepts individually.</div></p><p>The <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span> result tests any value by applying the contracts in
order, from left to right, with the exception that it always moves the
non-<a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contracts</span></a> (if any) to the end, checking them
last. Thus, a contract such as <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="RktValLink" data-pltdoc="x">not/c</a></span><span class="stt"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span><span class="RktPn">)</span><span class="stt"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._positive~3f%29%29" class="RktValLink" data-pltdoc="x">positive?</a></span><span class="RktPn">)</span> is guaranteed to only invoke the <span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._positive~3f%29%29" class="RktValLink" data-pltdoc="x">positive?</a></span>
predicate on real numbers.</p><p>If all of the arguments are procedures or <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contracts</span></a>, the
result is a <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contract</span></a>. If only one of the arguments is a
higher-order contract, the result is a contract that just checks the
flat contracts and, if they don’t pass, applies the higher-order
contract.</p><p><div class="SIntrapara">If there are multiple higher-order contracts, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span> uses
<span class="RktSym"><a href="Building_New_Contract_Combinators.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._contract-first-order-passes~3f%29%29" class="RktValLink" data-pltdoc="x">contract-first-order-passes?</a></span> to distinguish between
them. More precisely, when an <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span> is checked, it first
checks all of the <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contracts</span></a>. If none of them pass, it
calls <span class="RktSym"><a href="Building_New_Contract_Combinators.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._contract-first-order-passes~3f%29%29" class="RktValLink" data-pltdoc="x">contract-first-order-passes?</a></span> with each of the
higher-order contracts. If only one returns true, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span> uses
that contract. If none of them return true, it signals a contract
violation. If more than one returns true, it also signals a contract
violation.
For example, this contract
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">does not accept a function like this one: <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="stt"> </span><span class="RktSym">args</span><span class="stt"> </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>
since it cannot tell which of the two arrow contracts should be used
with the function.</div></p><p>If all of its arguments are <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span>s, then <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span>
returns a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._and/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">and/c</a></span></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Takes any number of contracts and returns a contract that
accepts any value that satisfies all of the contracts simultaneously.</div></p><p>If all of the arguments are procedures or <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contracts</span></a>,
the result is a <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contract</span></a>.</p><p>The contract produced by <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span> tests any value by applying
the contracts in order, from left to right.</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/contract/private/misc..rkt)._not/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">not/c</a></span></span><span class="hspace"> </span><span class="RktVar">flat-contract</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flat-contract</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Accepts a flat contracts or a predicate and returns a flat contract
that checks the inverse of the argument.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._~3d/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3d%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">=/c</a></span></span><span class="hspace"> </span><span class="RktVar">z</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">z</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a flat contract that requires the input to be a number and
<span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3d%29%29" class="RktValLink" data-pltdoc="x">=</a></span> to <span class="RktVar">z</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._~3c/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x"></c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a flat contract that requires the input to be a number and
<span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3c%29%29" class="RktValLink" data-pltdoc="x"><</a></span> than <span class="RktVar">n</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._~3e/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3e%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">>/c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c%2Fc%29%29" class="RktValLink" data-pltdoc="x"></c</a></span>, but for <span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3e%29%29" class="RktValLink" data-pltdoc="x">></a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._~3c~3d/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c~3d%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x"><=/c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c%2Fc%29%29" class="RktValLink" data-pltdoc="x"></c</a></span>, but for <span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3c~3d%29%29" class="RktValLink" data-pltdoc="x"><=</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._~3e~3d/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3e~3d%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">>=/c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._~3c%2Fc%29%29" class="RktValLink" data-pltdoc="x"></c</a></span>, but for <span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3e~3d%29%29" class="RktValLink" data-pltdoc="x">>=</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._between/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._between%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">between/c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span><span class="RktVar">m</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">m</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara"> Returns a flat contract that requires the
input to be a real number between <span class="RktVar">n</span> and <span class="RktVar">m</span> or equal to
one of them.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._real-in))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._real-in%29%29" class="RktValDef RktValLink" data-pltdoc="x">real-in</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span><span class="RktVar">m</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">m</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">An alias for <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._between%2Fc%29%29" class="RktValLink" data-pltdoc="x">between/c</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._integer-in))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._integer-in%29%29" class="RktValDef RktValLink" data-pltdoc="x">integer-in</a></span></span><span class="hspace"> </span><span class="RktVar">j</span><span class="hspace"> </span><span class="RktVar">k</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">j</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">k</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-integer?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a flat contract that requires the input to be an exact integer
between <span class="RktVar">j</span> and <span class="RktVar">k</span>, inclusive.</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>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/contract/private/misc..rkt)._natural-number/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._natural-number%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">natural-number/c</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A flat contract that requires the input to be an exact non-negative integer.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._string-len/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._string-len%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-len/c</a></span></span><span class="hspace"> </span><span class="RktVar">len</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">len</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a flat contract that recognizes strings that have fewer than
<span class="RktVar">len</span> characters.</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>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/contract/private/misc..rkt)._false/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._false%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">false/c</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">An alias <span class="RktVal">#f</span> for backwards compatibility.</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>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/contract/private/misc..rkt)._printable/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._printable%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">printable/c</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A flat contract that recognizes values that can be written out and
read back in with <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._write%29%29" class="RktValLink" data-pltdoc="x">write</a></span> and <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/base..rkt)._one-of/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._one-of%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">one-of/c</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Accepts any number of atomic values and returns a flat contract that
recognizes those values, using <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eqv~3f%29%29" class="RktValLink" data-pltdoc="x">eqv?</a></span> as the comparison
predicate. For the purposes of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._one-of%2Fc%29%29" class="RktValLink" data-pltdoc="x">one-of/c</a></span>, atomic values are
defined to be: <a href="characters.html#%28tech._character%29" class="techoutside" data-pltdoc="x"><span class="techinside">characters</span></a>, <a href="symbols.html#%28tech._symbol%29" class="techoutside" data-pltdoc="x"><span class="techinside">symbols</span></a>, <a href="booleans.html#%28tech._boolean%29" class="techoutside" data-pltdoc="x"><span class="techinside">booleans</span></a>,
<span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._null%29%29" class="RktValLink" data-pltdoc="x">null</a></span>, <a href="keywords.html#%28tech._keyword%29" class="techoutside" data-pltdoc="x"><span class="techinside">keywords</span></a>, <a href="numbers.html#%28tech._number%29" class="techoutside" data-pltdoc="x"><span class="techinside">numbers</span></a>,
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a>, and <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<undefined></span></span></a>.</div></p><p>This is a backwards compatibility contract constructor. If
neither <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a> nor <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<undefined></span></span></a> are arguments,
it simply passes its arguments to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/base..rkt)._symbols))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._symbols%29%29" class="RktValDef RktValLink" data-pltdoc="x">symbols</a></span></span><span class="hspace"> </span><span class="RktVar">sym</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">sym</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Accepts any number of symbols and returns a flat contract that
recognizes those symbols.</div></p><p>This is a backwards compatibility constructor; it merely
passes its arguments to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</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>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/vector..rkt)._vectorof))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="RktValDef RktValLink" data-pltdoc="x">vectorof</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">c</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVar">immutable</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVar">flat?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">immutable</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flat?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes vectors. The elements of the vector must
match <span class="RktVar">c</span>.</div></p><p>If the <span class="RktVar">flat?</span> argument is <span class="RktVal">#t</span>, then the resulting contract is
a flat contract, and the <span class="RktVar">c</span> argument must also be a flat contract. Such
flat contracts will be unsound if applied to mutable vectors, as they will not
check future operations on the vector.</p><p>If the <span class="RktVar">immutable</span> argument is <span class="RktVal">#t</span> and the <span class="RktVar">c</span> argument is
a flat contract, the result will be a flat contract. If the <span class="RktVar">c</span> argument
is a chaperone contract, then the result will be a chaperone contract.</p><p>When a higher-order <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="RktValLink" data-pltdoc="x">vectorof</a></span> contract is applied to a vector, the result
is not <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input. The result will be a copy for immutable vectors
and a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> or <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> of the input for mutable vectors.</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/contract/private/vector..rkt)._vector-immutableof))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector-immutableof%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-immutableof</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the same contract as <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="RktValLink" data-pltdoc="x">vectorof</a></span><span class="stt"> </span><span class="RktVar">c</span><span class="stt"> </span><span class="RktPn">#:immutable</span><span class="stt"> </span><span class="RktVal">#t</span><span class="RktPn">)</span>. This form exists for
backwards compatibility.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/vector..rkt)._vector/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector/c</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">c</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktMeta">...</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVar">immutable</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVar">flat?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">immutable</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flat?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes vectors whose lengths match the number of
contracts given. Each element of the vector must match its corresponding contract.</div></p><p>If the <span class="RktVar">flat?</span> argument is <span class="RktVal">#t</span>, then the resulting contract is
a flat contract, and the <span class="RktVar">c</span> arguments must also be flat contracts. Such
flat contracts will be unsound if applied to mutable vectors, as they will not
check future operations on the vector.</p><p>If the <span class="RktVar">immutable</span> argument is <span class="RktVal">#t</span> and the <span class="RktVar">c</span> arguments are
flat contracts, the result will be a flat contract. If the <span class="RktVar">c</span> arguments
are chaperone contracts, then the result will be a chaperone contract.</p><p>When a higher-order <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector%2Fc%29%29" class="RktValLink" data-pltdoc="x">vector/c</a></span> contract is applied to a vector, the result
is not <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input. The result will be a copy for immutable vectors
and a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> or <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> of the input for mutable vectors.</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/contract/private/vector..rkt)._vector-immutable/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector-immutable%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-immutable/c</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the same contract as <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vector%2Fc%29%29" class="RktValLink" data-pltdoc="x">vector/c</a></span><span class="stt"> </span><span class="RktVar">c</span><span class="stt"> </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="stt"> </span><span class="RktPn">#:immutable</span><span class="stt"> </span><span class="RktVal">#t</span><span class="RktPn">)</span>. This form exists for
reasons of backwards compatibility.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/box..rkt)._box/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">box/c</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">c</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVar">immutable</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVar">flat?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">immutable</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flat?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes boxes. The content of the box must match <span class="RktVar">c</span>.</div></p><p>If the <span class="RktVar">flat?</span> argument is <span class="RktVal">#t</span>, then the resulting contract is
a flat contract, and the <span class="RktVar">c</span> argument must also be a flat contract. Such
flat contracts will be unsound if applied to mutable boxes, as they will not check
future operations on the box.</p><p>If the <span class="RktVar">immutable</span> argument is <span class="RktVal">#t</span> and the <span class="RktVar">c</span> argument is
a flat contract, the result will be a flat contract. If the <span class="RktVar">c</span> argument is
a chaperone contract, then the result will be a chaperone contract.</p><p>When a higher-order <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box%2Fc%29%29" class="RktValLink" data-pltdoc="x">box/c</a></span> contract is applied to a box, the result
is not <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input. The result will be a copy for immutable boxes
and either a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> or <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> of the input for mutable boxes.</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/contract/private/box..rkt)._box-immutable/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box-immutable%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">box-immutable/c</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the same contract as <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fbox..rkt%29._box%2Fc%29%29" class="RktValLink" data-pltdoc="x">box/c</a></span><span class="stt"> </span><span class="RktVar">c</span><span class="stt"> </span><span class="RktPn">#:immutable</span><span class="stt"> </span><span class="RktVal">#t</span><span class="RktPn">)</span>. This form exists for
reasons of backwards compatibility.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._listof))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValDef RktValLink" data-pltdoc="x">listof</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes a list whose every element matches
the contract <span class="RktVar">c</span>. Beware that when this contract is applied to
a value, the result is not necessarily <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._non-empty-listof))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._non-empty-listof%29%29" class="RktValDef RktValLink" data-pltdoc="x">non-empty-listof</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes non-empty lists whose elements match
the contract <span class="RktVar">c</span>. Beware that when this contract is applied to
a value, the result is not necessarily <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._cons/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._cons%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">cons/c</a></span></span><span class="hspace"> </span><span class="RktVar">car-c</span><span class="hspace"> </span><span class="RktVar">cdr-c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">car-c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">cdr-c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract that recognizes pairs whose first and second elements
match <span class="RktVar">car-c</span> and <span class="RktVar">cdr-c</span>, respectively. Beware that
when this contract is applied to a value, the result is not
necessarily <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input.</div></p><p>If the <span class="RktVar">cdr-c</span> contract is a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span>, then
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span> returns a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span>.</p><p class="SHistory">Changed in version 6.0.1.13 of package <span class="stt">base</span>: Added the <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span> propagating behavior.</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/contract/private/misc..rkt)._list/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._list%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">list/c</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._list-contract~3f%29%29" class="RktValLink" data-pltdoc="x">list-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract for a list. The number of elements in the list
must match the number of arguments supplied to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._list%2Fc%29%29" class="RktValLink" data-pltdoc="x">list/c</a></span>, and
each element of the list must match the corresponding contract. Beware
that when this contract is applied to a value, the result is not
necessarily <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._syntax/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._syntax%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">syntax/c</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a flat contract that recognizes syntax objects whose
<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-e%29%29" class="RktValLink" data-pltdoc="x">syntax-e</a></span> content matches <span class="RktVar">c</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/contract/private/struct-dc..rkt)._struct/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">struct/c</a></span></span><span class="hspace"> </span><span class="RktVar">struct-id</span><span class="hspace"> </span><span class="RktVar">contract-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract that recognizes instances of the structure
type named by <span class="RktVar">struct-id</span>, and whose field values match the
contracts produced by the <span class="RktVar">contract-expr</span>s.</div></p><p>Contracts for immutable fields must be either flat or chaperone contracts.
Contracts for mutable fields may be impersonator contracts.
If all fields are immutable and the <span class="RktVar">contract-expr</span>s evaluate
to flat contracts, a flat contract is produced. If all the
<span class="RktVar">contract-expr</span>s are chaperone contracts, a chaperone contract is
produced. Otherwise, an impersonator contract is produced.</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/contract/private/struct-dc..rkt)._struct/dc))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fdc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">struct/dc</a></span></span><span class="hspace"> </span><span class="RktVar">struct-id</span><span class="hspace"> </span><span class="RktVar">field-spec</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">maybe-inv</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">field-spec</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">field-name</span><span class="hspace"> </span><span class="RktVar">maybe-lazy</span><span class="hspace"> </span><span class="RktVar">contract-expr</span><span class="RktPn">]</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">[</span><span class="RktVar">field-name</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">dep-field-name</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-lazy</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">maybe-contract-type</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">maybe-dep-state</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contract-expr</span><span class="RktPn">]</span></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"><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">field-name</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">field-id</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktPn">#:selector</span><span class="hspace"> </span><span class="RktVar">selector-id</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">field-id</span><span class="hspace"> </span><span class="RktPn">#:parent</span><span class="hspace"> </span><span class="RktVar">struct-id</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-lazy</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">#:lazy</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-contract-type</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">#:flat</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">#:chaperone</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">#:impersonator</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-dep-state</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">#:depends-on-state</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-inv</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">#:inv</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">dep-field-name</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">invariant-expr</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract that recognizes instances of the structure
type named by <span class="RktVar">struct-id</span>, and whose field values match the
contracts produced by the <span class="RktVar">field-spec</span>s.</div></p><p>If the <span class="RktVar">field-spec</span> lists the names of other fields,
then the contract depends on values in those fields, and the <span class="RktVar">contract-expr</span>
expression is evaluated each time a selector is applied, building a new contract
for the fields based on the values of the <span class="RktVar">dep-field-name</span> fields (the
<span class="RktVar">dep-field-name</span> syntax is the same as the <span class="RktVar">field-name</span> syntax).
If the field is a dependent field and no <span class="RktSym">contract-type</span> annotation
appears, then it is assumed that the contract is
a chaperone, but not always a flat contract (and thus the entire <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fdc%29%29" class="RktStxLink" data-pltdoc="x">struct/dc</a></span>
contract is not a flat contract).
If this is not the case, and the contract is
always flat then the field must be annotated with
the <span class="RktPn">#:flat</span>, or the field must be annotated with
<span class="RktPn">#:impersonator</span> (in which case, it must be a mutable field).</p><p>A <span class="RktVar">field-name</span> is either an identifier naming a field in the first
case, an identifier naming a selector in the second case indicated
by the <span class="RktPn">#:selector</span> keyword, or
a field id for a struct that is a parent of <span class="RktVar">struct-id</span>, indicated
by the <span class="RktPn">#:parent</span> keyword.</p><p>If the <span class="RktPn">#:lazy</span> keyword appears, then the contract
on the field is check lazily (only when a selector is applied);
<span class="RktPn">#:lazy</span> contracts cannot be put on mutable fields.</p><p>If a dependent contract depends on some mutable state, then use the
<span class="RktPn">#:depends-on-state</span> keyword argument (if a field’s dependent contract
depends on a mutable field, this keyword is automatically inferred).
The presence of this keyword means that the contract expression is evaluated
each time the corresponding field is accessed (or mutated, if it is a mutable
field). Otherwise, the contract expression for a dependent field contract
is evaluated when the contract is applied to a value.</p><p>If the <span class="RktPn">#:inv</span> clause appears, then the invariant expression is
evaluated (and must return a non-<span class="RktVal">#f</span> value) when the contract
is applied to a struct.</p><p>Contracts for immutable fields must be either flat or chaperone contracts.
Contracts for mutable fields may be impersonator contracts.
If all fields are immutable and the <span class="RktVar">contract-expr</span>s evaluate
to flat contracts, a flat contract is produced. If all the
<span class="RktVar">contract-expr</span>s are chaperone contracts, a chaperone contract is
produced. Otherwise, an impersonator contract is produced.</p><p>As an example, the function <span class="RktSym">bst/c</span> below
returns a contract for binary search trees whose values
are all between <span class="RktSym">lo</span> and <span class="RktSym">hi</span>.
The lazy annotations ensure that this contract does not
change the running time of operations that do not
inspect the entire tree.</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29" class="RktStxLink" data-pltdoc="x">struct</a></span><span class="hspace"> </span><span class="RktSym">bt</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">val</span><span class="hspace"> </span><span class="RktSym">left</span><span class="hspace"> </span><span class="RktSym">right</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bst/c</span><span class="hspace"> </span><span class="RktSym">lo</span><span class="hspace"> </span><span class="RktSym">hi</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fstruct-dc..rkt%29._struct%2Fdc%29%29" class="RktStxLink" data-pltdoc="x">struct/dc</a></span><span class="hspace"> </span><span class="RktSym">bt</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">val</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._between%2Fc%29%29" class="RktValLink" data-pltdoc="x">between/c</a></span><span class="hspace"> </span><span class="RktSym">lo</span><span class="hspace"> </span><span class="RktSym">hi</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">left</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">val</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:lazy</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bst</span><span class="hspace"> </span><span class="RktSym">lo</span><span class="hspace"> </span><span class="RktSym">val</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">right</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">val</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:lazy</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">bst</span><span class="hspace"> </span><span class="RktSym">val</span><span class="hspace"> </span><span class="RktSym">hi</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p class="SHistory">Changed in version 6.0.1.6 of package <span class="stt">base</span>: Added <span class="RktPn">#:inv</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._parameter/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">parameter/c</a></span></span><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </span>[<span class="RktVar">out</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">in</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">out</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVar">in</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract on parameters whose values must match
<span class="RktVar">out</span>. When the value in the contracted parameter
is set, it must match <span class="RktVar">in</span>.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">current-snack</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%29%29" class="RktValLink" data-pltdoc="x">parameter/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</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="parameters.html#%28def._%28%28quote._~23~25kernel%29._make-parameter%29%29" class="RktValLink" data-pltdoc="x">make-parameter</a></span><span class="hspace"> </span><span class="RktVal">"potato-chip"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">baked/c</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-named-contract%29%29" class="RktValLink" data-pltdoc="x">flat-named-contract</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">baked/c</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">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="regexp.html#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"baked"</span><span class="hspace"> </span><span class="RktSym">s</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">current-dinner</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%29%29" class="RktValLink" data-pltdoc="x">parameter/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym">baked/c</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="parameters.html#%28def._%28%28quote._~23~25kernel%29._make-parameter%29%29" class="RktValLink" data-pltdoc="x">make-parameter</a></span><span class="hspace"> </span><span class="RktVal">"turkey"</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">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-append%29%29" class="RktValLink" data-pltdoc="x">string-append</a></span><span class="hspace"> </span><span class="RktVal">"roasted "</span><span class="hspace"> </span><span class="RktSym">s</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">current-snack</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">not-a-snack</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">current-snack: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: string?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: 'not-a-snack</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: the parameter of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(parameter/c string?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition current-snack)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:2.0</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="parameters.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._parameterize%29%29" class="RktStxLink" data-pltdoc="x">parameterize</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">current-dinner</span><span class="hspace"> </span><span class="RktVal">"tofurkey"</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">current-dinner</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">current-dinner: broke its contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">promised: baked/c</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">produced: "roasted tofurkey"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: the parameter of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(parameter/c string? baked/c)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition current-dinner)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: (definition current-dinner)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:4.0</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._procedure-arity-includes/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._procedure-arity-includes%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">procedure-arity-includes/c</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract for procedures that accept <span class="RktVar">n</span> argument
(i.e,. the <span class="RktSym"><a href="procedures.html#%28def._%28%28quote._~23~25kernel%29._procedure~3f%29%29" class="RktValLink" data-pltdoc="x">procedure?</a></span> contract is implied).</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/hash..rkt)._hash/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash/c</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">key</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">val</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVar">immutable</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVar">flat?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">val</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">immutable</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dont-care</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flat?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract that recognizes <span class="RktSym"><a href="hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash%29%29" class="RktValLink" data-pltdoc="x">hash</a></span> tables with keys and values
as specified by the <span class="RktVar">key</span> and <span class="RktVar">val</span> arguments.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">good-hash</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><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="hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash%29%29" class="RktValLink" data-pltdoc="x">hash</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">bad-hash</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><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="hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash%29%29" class="RktValLink" data-pltdoc="x">hash</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">"elephant"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">"monkey"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">"manatee"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">bad-hash: broke its contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">promised: boolean?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">produced: "elephant"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: the values of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(hash/c integer? boolean?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition bad-hash)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: (definition bad-hash)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:3.0</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara">There are a number of technicalities that control how <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span> contracts
behave.
</div><div class="SIntrapara"><ul><li><p>If the <span class="RktVar">flat?</span> argument is <span class="RktVal">#t</span>, then the resulting contract is
a flat contract, and the <span class="RktVar">key</span> and <span class="RktVar">val</span> arguments must also be flat
contracts.</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="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">hash/c: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: flat-contract?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: #<chaperone-contract: (-> integer? integer?)></span></p></td></tr></table></blockquote></td></tr></table></p><p>Such flat contracts will be unsound if applied to mutable hash tables,
as they will not check future mutations to the hash table.</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="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">original-h</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="hashtables.html#%28def._%28%28quote._~23~25kernel%29._make-hasheq%29%29" class="RktValLink" data-pltdoc="x">make-hasheq</a></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="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">ctc-h</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span><span class="RktPn">#:flat?</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktSym">original-h</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="hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash-set%21%29%29" class="RktValLink" data-pltdoc="x">hash-set!</a></span><span class="hspace"> </span><span class="RktSym">original-h</span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">"not a boolean"</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="hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash-ref%29%29" class="RktValLink" data-pltdoc="x">hash-ref</a></span><span class="hspace"> </span><span class="RktSym">ctc-h</span><span class="hspace"> </span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"not a boolean"</span></p></td></tr></table></blockquote></td></tr></table></li><li><p>If the <span class="RktVar">immutable</span> argument is <span class="RktVal">#t</span> and the <span class="RktVar">key</span> and
<span class="RktVar">val</span> arguments are <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span>s, the result will be a
<span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</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="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></td></tr></table></p><p>If either the domain or the range is a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span>, then the result will
be a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span>.</p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">#:immutable</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></td></tr></table></li><li><p><div class="SIntrapara">If the <span class="RktVar">key</span> argument is a <span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span> but not a
<span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span>, then the resulting contract
can be applied only to <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span>-based hash tables.
</div><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">h</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._integer~3f%29%29" class="RktValLink" data-pltdoc="x">integer?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</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="hashtables.html#%28def._%28%28quote._~23~25kernel%29._make-hasheq%29%29" class="RktValLink" data-pltdoc="x">make-hasheq</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">h: broke its contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">promised equal?-based hash table due to higher-order</span></p></td></tr><tr><td><p><span class="RktErr">domain contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">produced: '#hasheq()</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: (hash/c (-> integer? integer?) any/c)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition h)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: (definition h)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:2.0</span></p></td></tr></table></blockquote></td></tr></table></div><div class="SIntrapara">Also, when such a <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fhash..rkt%29._hash%2Fc%29%29" class="RktValLink" data-pltdoc="x">hash/c</a></span> contract is applied to a hash table, the result is not
<span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span>
to the input. The result of applying the contract will be a copy for immutable hash tables,
and either a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> or <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> of the original hash table
for mutable hash tables.</div></p></li></ul></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._channel/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._channel%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">channel/c</a></span></span><span class="hspace"> </span><span class="RktVar">val</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">val</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a contract that recognizes <a href="channel.html#%28tech._channel%29" class="techoutside" data-pltdoc="x"><span class="techinside">channel</span></a>s that communicate
values as specified by the <span class="RktVar">val</span> argument.</div></p><p>If the <span class="RktVar">val</span> argument is a chaperone contract, then the resulting contract
is a chaperone contract. Otherwise, the resulting contract is an impersonator
contract. When a channel contract is applied to a channel, the resulting channel
is not <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29" class="RktValLink" data-pltdoc="x">eq?</a></span> to the input.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">chan</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._channel%2Fc%29%29" class="RktValLink" data-pltdoc="x">channel/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</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="channel.html#%28def._%28%28quote._~23~25kernel%29._make-channel%29%29" class="RktValLink" data-pltdoc="x">make-channel</a></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="threads.html#%28def._%28%28quote._~23~25kernel%29._thread%29%29" class="RktValLink" data-pltdoc="x">thread</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._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</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="channel.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._channel-get%29%29" class="RktValLink" data-pltdoc="x">channel-get</a></span><span class="hspace"> </span><span class="RktSym">chan</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#<thread></span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="channel.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._channel-put%29%29" class="RktValLink" data-pltdoc="x">channel-put</a></span><span class="hspace"> </span><span class="RktSym">chan</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">not-a-string</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">chan: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: string?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: 'not-a-string</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: (channel/c string?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition chan)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:2.0</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/contract/private/misc..rkt)._prompt-tag/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._prompt-tag%2Fc%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">prompt-tag/c</a></span></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktVar">maybe-call/cc</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">maybe-call/cc</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">#:call/cc</span><span class="hspace"> </span><span class="RktVar">contract</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">#:call/cc</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="values.html#%28def._%28%28quote._~23~25kernel%29._values%29%29" class="RktValLink" data-pltdoc="x">values</a></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="stt"> </span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">contract</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Takes any number of contracts and returns a contract that recognizes
continuation prompt tags and will check any aborts or prompt handlers that
use the contracted prompt tag.</div></p><p>Each <span class="RktVar">contract</span> will check the corresponding value passed to
an <span class="RktSym"><a href="cont.html#%28def._%28%28quote._~23~25kernel%29._abort-current-continuation%29%29" class="RktValLink" data-pltdoc="x">abort-current-continuation</a></span> and handled by the handler of a
call to <span class="RktSym"><a href="cont.html#%28def._%28%28quote._~23~25kernel%29._call-with-continuation-prompt%29%29" class="RktValLink" data-pltdoc="x">call-with-continuation-prompt</a></span>.</p><p>If all of the <span class="RktVar">contract</span>s are chaperone contracts, the resulting
contract will also be a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> contract. Otherwise, the contract is
an <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> contract.</p><p>If <span class="RktVar">maybe-call/cc</span> is provided, then the provided contracts
are used to check the return values from a continuation captured with
<span class="RktSym"><a href="cont.html#%28def._%28%28quote._~23~25kernel%29._call-with-current-continuation%29%29" class="RktValLink" data-pltdoc="x">call-with-current-continuation</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym"><a href="creatingunits.html#%28form._%28%28lib._racket%2Funit..rkt%29._tag%29%29" class="RktStxLink" data-pltdoc="x">tag</a></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%2Fcontract%2Fprivate%2Fmisc..rkt%29._prompt-tag%2Fc%29%29" class="RktStxLink" data-pltdoc="x">prompt-tag/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="cont.html#%28def._%28%28quote._~23~25kernel%29._make-continuation-prompt-tag%29%29" class="RktValLink" data-pltdoc="x">make-continuation-prompt-tag</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="cont.html#%28def._%28%28quote._~23~25kernel%29._call-with-continuation-prompt%29%29" class="RktValLink" data-pltdoc="x">call-with-continuation-prompt</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._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</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="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._number-~3estring%29%29" class="RktValLink" data-pltdoc="x">number->string</a></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-with-composable-continuation%29%29" class="RktValLink" data-pltdoc="x">call-with-composable-continuation</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._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">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="cont.html#%28def._%28%28quote._~23~25kernel%29._abort-current-continuation%29%29" class="RktValLink" data-pltdoc="x">abort-current-continuation</a></span><span class="hspace"> </span><span class="RktSym"><a href="creatingunits.html#%28form._%28%28lib._racket%2Funit..rkt%29._tag%29%29" class="RktStxLink" data-pltdoc="x">tag</a></span><span class="hspace"> </span><span class="RktSym">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="RktSym"><a href="creatingunits.html#%28form._%28%28lib._racket%2Funit..rkt%29._tag%29%29" class="RktStxLink" data-pltdoc="x">tag</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._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">k</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">k</span><span class="hspace"> </span><span class="RktVal">"not a number"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">tag: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: number?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: "not a number"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: the 1st argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(prompt-tag/c</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(-> number? string?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">#:call/cc)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition tag)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:2.0</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._continuation-mark-key/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._continuation-mark-key%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">continuation-mark-key/c</a></span></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Takes a single contract and returns a contract that recognizes
continuation marks and will check any mappings of marks to values
or any accesses of the mark value.</div></p><p>If the argument <span class="RktVar">contract</span> is a chaperone contract, the resulting
contract will also be a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> contract. Otherwise, the contract is
an <a href="chaperones.html#%28tech._impersonator%29" class="techoutside" data-pltdoc="x"><span class="techinside">impersonator</span></a> contract.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">mark-key</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._continuation-mark-key%2Fc%29%29" class="RktValLink" data-pltdoc="x">continuation-mark-key/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></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="contmarks.html#%28def._%28%28quote._~23~25kernel%29._make-continuation-mark-key%29%29" class="RktValLink" data-pltdoc="x">make-continuation-mark-key</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="wcm.html#%28form._%28%28quote._~23~25kernel%29._with-continuation-mark%29%29" class="RktStxLink" data-pltdoc="x">with-continuation-mark</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktSym">mark-key</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._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._append%29%29" class="RktValLink" data-pltdoc="x">append</a></span><span class="hspace"> </span><span class="RktSym">s</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">truffle</span><span class="hspace"> </span><span class="RktVal">fudge</span><span class="hspace"> </span><span class="RktVal">ganache</span><span class="RktVal">)</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="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">mark-value</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="contmarks.html#%28def._%28%28quote._~23~25kernel%29._continuation-mark-set-first%29%29" class="RktValLink" data-pltdoc="x">continuation-mark-set-first</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="contmarks.html#%28def._%28%28quote._~23~25kernel%29._current-continuation-marks%29%29" class="RktValLink" data-pltdoc="x">current-continuation-marks</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">mark-key</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">mark-value</span><span class="hspace"> </span><span class="RktVal">"chocolate-bar"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">mark-key: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: symbol?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: "chocolate-bar"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: the 1st argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(continuation-mark-key/c</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">(-> symbol? (listof symbol?)))</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition mark-key)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:2.0</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>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._evt/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._evt%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">evt/c</a></span></span><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contract</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._chaperone-contract~3f%29%29" class="RktValLink" data-pltdoc="x">chaperone-contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a contract that recognizes <a href="sync.html#%28tech._synchronizable._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">synchronizable event</span></a>s whose
<a href="sync.html#%28tech._synchronization._result%29" class="techoutside" data-pltdoc="x"><span class="techinside">synchronization result</span></a>s are checked by the given
<span class="RktVar">contract</span>s.</div></p><p>The resulting contract is always a <a href="chaperones.html#%28tech._chaperone%29" class="techoutside" data-pltdoc="x"><span class="techinside">chaperone</span></a> contract and its
arguments must all be chaperone contracts.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">my-evt</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._evt%2Fc%29%29" class="RktValLink" data-pltdoc="x">evt/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="sync.html#%28def._%28%28quote._~23~25kernel%29._evt~3f%29%29" class="RktValLink" data-pltdoc="x">evt?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktSym"><a href="sync.html#%28def._%28%28quote._~23~25kernel%29._always-evt%29%29" class="RktValLink" data-pltdoc="x">always-evt</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define%2Fcontract%29%29" class="RktStxLink" data-pltdoc="x">define/contract</a></span><span class="hspace"> </span><span class="RktSym">failing-evt</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._evt%2Fc%29%29" class="RktValLink" data-pltdoc="x">evt/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</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="sync.html#%28def._%28%28quote._~23~25kernel%29._alarm-evt%29%29" class="RktValLink" data-pltdoc="x">alarm-evt</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="time.html#%28def._%28%28quote._~23~25kernel%29._current-inexact-milliseconds%29%29" class="RktValLink" data-pltdoc="x">current-inexact-milliseconds</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">50</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="sync.html#%28def._%28%28quote._~23~25kernel%29._sync%29%29" class="RktValLink" data-pltdoc="x">sync</a></span><span class="hspace"> </span><span class="RktSym">my-evt</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#<always-evt></span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="sync.html#%28def._%28%28quote._~23~25kernel%29._sync%29%29" class="RktValLink" data-pltdoc="x">sync</a></span><span class="hspace"> </span><span class="RktSym">failing-evt</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">failing-evt: broke its contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">promised: event that produces 2 values</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">produced: event that produces 1 values</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">in: (evt/c number? number?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">contract from: (definition failing-evt)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">blaming: (definition failing-evt)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">at: eval:3.0</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/contract/base..rkt)._flat-rec-contract))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._flat-rec-contract%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">flat-rec-contract</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">flat-contract-expr</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a recursive <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contract</span></a>. A
<span class="RktVar">flat-contract-expr</span> can refer to <span class="RktVar">id</span> to refer
recursively to the generated contract.</div></p><p>For example, the contract</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._flat-rec-contract%29%29" class="RktStxLink" data-pltdoc="x">flat-rec-contract</a></span><span class="hspace"> </span><span class="RktSym">sexp</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym">sexp</span><span class="hspace"> </span><span class="RktSym">sexp</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._number~3f%29%29" class="RktValLink" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span><span class="RktPn">)</span></td></tr></table></blockquote><p>is a flat contract that checks for (a limited form of)
S-expressions. It says that a <span class="RktSym">sexp</span> is either two
<span class="RktSym">sexp</span>s combined with <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span>, or a number, or a symbol.</p><p>Note that if the contract is applied to a circular value, contract
checking will not terminate.</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/contract/private/misc..rkt)._flat-murec-contract))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-murec-contract%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">flat-murec-contract</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">flat-contract-expr</span><span class="hspace"> </span><span class="RktMeta">...</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</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A generalization of <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._flat-rec-contract%29%29" class="RktStxLink" data-pltdoc="x">flat-rec-contract</a></span> for defining several
mutually recursive flat contracts simultaneously. Each <span class="RktVar">id</span> is
visible in the entire <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-murec-contract%29%29" class="RktStxLink" data-pltdoc="x">flat-murec-contract</a></span> form, and the
result of the final <span class="RktVar">body</span> is the result of the entire form.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._racket/contract/private/misc..rkt)._any))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">any</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Represents a contract that is always satisfied. In particular, it can accept
multiple values. It can only be used in a result position of contracts like
<span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span>. Using <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span> elsewhere is a syntax error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._promise/c))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._promise%2Fc%29%29" class="RktValDef RktValLink" data-pltdoc="x">promise/c</a></span></span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._contract~3f%29%29" class="RktValLink" data-pltdoc="x">contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a contract on a promise. The contract does not force the
promise, but when the promise is forced, the contract checks that the
result value meets the contract <span class="RktVar">c</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/contract/private/misc..rkt)._flat-contract))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract%29%29" class="RktValDef RktValLink" data-pltdoc="x">flat-contract</a></span></span><span class="hspace"> </span><span class="RktVar">predicate</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">predicate</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a <a href="contracts.html#%28tech._flat._contract%29" class="techoutside" data-pltdoc="x"><span class="techinside">flat contract</span></a> from <span class="RktVar">predicate</span>. A value
satisfies the contract if the predicate returns a true value.</div></p><p>This function is a holdover from before flat contracts could be used
directly as predicates. It exists today for backwards compatibilty.</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/contract/private/misc..rkt)._flat-contract-predicate))"></a><span title="Provided from: racket/contract/base, racket/contract, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract-predicate%29%29" class="RktValDef RktValLink" data-pltdoc="x">flat-contract-predicate</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract~3f%29%29" class="RktValLink" data-pltdoc="x">flat-contract?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the predicate from a flat contract.</div></p><p>This function is a holdover from before flat contracts could
be used directly as predicates. It exists today for backwards compatibility.</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="contracts.html" title="backward to "8 Contracts"" data-pltdoc="x">← prev</a> <a href="contracts.html" title="up to "8 Contracts"" data-pltdoc="x">up</a> <a href="function-contracts.html" title="forward to "8.2 Function Contracts"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|