/usr/share/doc/racket/reference/eval.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | <!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>14.2 Evaluation and Compilation</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="icons.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="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="tocviewselflink" 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>14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">14.1 </td><td><a href="Namespaces.html" class="tocviewlink" data-pltdoc="x">Namespaces</a></td></tr><tr><td align="right">14.2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Evaluation and Compilation</a></td></tr><tr><td align="right">14.3 </td><td><a href="load-lang.html" class="tocviewlink" data-pltdoc="x">The <span class="RktModLink"><span class="RktSym">racket/<span class="mywbr"> </span>load</span></span> Language</a></td></tr><tr><td align="right">14.4 </td><td><a href="Module_Names_and_Loading.html" class="tocviewlink" data-pltdoc="x">Module Names and Loading</a></td></tr><tr><td align="right">14.5 </td><td><a href="chaperones.html" class="tocviewlink" data-pltdoc="x">Impersonators and Chaperones</a></td></tr><tr><td align="right">14.6 </td><td><a href="securityguards.html" class="tocviewlink" data-pltdoc="x">Security Guards</a></td></tr><tr><td align="right">14.7 </td><td><a href="custodians.html" class="tocviewlink" data-pltdoc="x">Custodians</a></td></tr><tr><td align="right">14.8 </td><td><a href="threadgroups.html" class="tocviewlink" data-pltdoc="x">Thread Groups</a></td></tr><tr><td align="right">14.9 </td><td><a href="inspectors.html" class="tocviewlink" data-pltdoc="x">Structure Inspectors</a></td></tr><tr><td align="right">14.10 </td><td><a href="modprotect.html" class="tocviewlink" data-pltdoc="x">Code Inspectors</a></td></tr><tr><td align="right">14.11 </td><td><a href="plumbers.html" class="tocviewlink" data-pltdoc="x">Plumbers</a></td></tr><tr><td align="right">14.12 </td><td><a href="Sandboxed_Evaluation.html" class="tocviewlink" data-pltdoc="x">Sandboxed Evaluation</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%28quote._~23~25kernel%29._current-eval%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>eval</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eval</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._eval-syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eval-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>load</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load-<wbr></wbr>relative</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fcd%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load/<span class="mywbr"> </span>cd</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-extension%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>load-<wbr></wbr>extension</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._load-extension%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load-<wbr></wbr>extension</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative-extension%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load-<wbr></wbr>relative-<wbr></wbr>extension</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%2Fuse-compiled%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>load/<span class="mywbr"> </span>use-<wbr></wbr>compiled</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fuse-compiled%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load/<span class="mywbr"> </span>use-<wbr></wbr>compiled</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>load-<wbr></wbr>relative-<wbr></wbr>directory</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">use-<wbr></wbr>compiled-<wbr></wbr>file-<wbr></wbr>paths</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-compiled-file-roots%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>compiled-<wbr></wbr>file-<wbr></wbr>roots</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-check%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">use-<wbr></wbr>compiled-<wbr></wbr>file-<wbr></wbr>check</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>eval-<wbr></wbr>print-<wbr></wbr>loop</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-prompt-read%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>prompt-<wbr></wbr>read</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-get-interaction-input-port%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>get-<wbr></wbr>interaction-<wbr></wbr>input-<wbr></wbr>port</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-read-interaction%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>read-<wbr></wbr>interaction</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-print%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>print</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-compile%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>compile</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compile%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compile</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compile-syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compile-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression-recompile%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compiled-<wbr></wbr>expression-<wbr></wbr>recompile</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compiled-<wbr></wbr>expression?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compile-enforce-module-constants%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compile-<wbr></wbr>enforce-<wbr></wbr>module-<wbr></wbr>constants</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compile-allow-set%21-undefined%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compile-<wbr></wbr>allow-<wbr></wbr>set!-<wbr></wbr>undefined</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._compile-context-preservation-enabled%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compile-<wbr></wbr>context-<wbr></wbr>preservation-<wbr></wbr>enabled</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._eval-jit-enabled%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eval-<wbr></wbr>jit-<wbr></wbr>enabled</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._load-on-demand-enabled%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">load-<wbr></wbr>on-<wbr></wbr>demand-<wbr></wbr>enabled</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="Namespaces.html" title="backward to "14.1 Namespaces"" data-pltdoc="x">← prev</a> <a href="security.html" title="up to "14 Reflection and Security"" data-pltdoc="x">up</a> <a href="load-lang.html" title="forward to "14.3 The racket/load Language"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""eval"">14.2<tt> </tt><a name="(part._eval)"></a>Evaluation and Compilation</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-eval))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-eval%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-eval</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-eval%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-eval</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current <a name="(tech._evaluation._handler)"></a><span style="font-style: italic">evaluation handler</span>.
The evaluation handler is a procedure that takes a top-level form and
evaluates it, returning the resulting values. The <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation
handler</span></a> is called by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</a></span>, <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval-syntax%29%29" class="RktValLink" data-pltdoc="x">eval-syntax</a></span>, the default
<a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a>, and <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> to evaluate a
top-level form. The handler should evaluate its argument in tail
position.</div></p><p>The <span class="RktVar">top-level-form</span> provided to the handler can be a
<a href="syntax-model.html#%28tech._syntax._object%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax object</span></a>, a compiled form, a compiled form wrapped as a
syntax object, or an arbitrary datum.</p><p>The default handler converts an arbitrary datum to a syntax object
using <span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._datum-~3esyntax%29%29" class="RktValLink" data-pltdoc="x">datum->syntax</a></span>, and then enriches its <a href="syntax-model.html#%28tech._lexical._information%29" class="techoutside" data-pltdoc="x"><span class="techinside">lexical
information</span></a> in the same way as <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</a></span>. (If
<span class="RktVar">top-level-form</span> is a syntax object, then its <a href="syntax-model.html#%28tech._lexical._information%29" class="techoutside" data-pltdoc="x"><span class="techinside">lexical
information</span></a> is not enriched.) The default evaluation handler
partially expands the form to splice the body of top-level
<span class="RktSym"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span> forms into the top level (see
<span class="RktSym"><a href="Expanding_Top-Level_Forms.html#%28def._%28%28quote._~23~25kernel%29._expand-to-top-form%29%29" class="RktValLink" data-pltdoc="x">expand-to-top-form</a></span>), and then individually compiles and
evaluates each spliced form before continuing to expand, compile, and
evaluate later forms.</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._((quote._~23~25kernel)._eval))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValDef RktValLink" data-pltdoc="x">eval</a></span></span><span class="hspace"> </span><span class="RktVar">top-level-form</span><span class="hspace"> </span>[<span class="RktVar">namespace</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">top-level-form</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">namespace</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._namespace~3f%29%29" class="RktValLink" data-pltdoc="x">namespace?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._current-namespace%29%29" class="RktValLink" data-pltdoc="x">current-namespace</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="finger.png" alt="+" width="24" height="24"/></span>See also <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=eval.html%23%2528part._namespaces%2529&version=6.7" class="Sq" data-pltdoc="x">Namespaces</a> in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=index.html&version=6.7" class="Sq" data-pltdoc="x"><span style="font-weight: bold">The Racket Guide</span></a>.</p></blockquote></blockquote></blockquote></div></p><p>Calls the current <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a> to evaluate
<span class="RktVar">top-level-form</span>. The <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a> is called in
tail position with respect to the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</a></span> call, and
<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>d to set <span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._current-namespace%29%29" class="RktValLink" data-pltdoc="x">current-namespace</a></span> to
<span class="RktVar">namespace</span>.</p><p>If <span class="RktVar">top-level-form</span> is a syntax object whose datum is not a
compiled form, then its <a href="syntax-model.html#%28tech._lexical._information%29" class="techoutside" data-pltdoc="x"><span class="techinside">lexical information</span></a> is enriched before
it is sent to the <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a>:</p><ul><li><p>If <span class="RktVar">top-level-form</span> is a pair whose <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29" class="RktValLink" data-pltdoc="x">car</a></span> is a
symbol or identifier, and if applying
<span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._namespace-syntax-introduce%29%29" class="RktValLink" data-pltdoc="x">namespace-syntax-introduce</a></span> to the
(<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._datum-~3esyntax%29%29" class="RktValLink" data-pltdoc="x">datum->syntax</a></span>-converted) identifier produces an
identifier bound to <span class="RktSym"><a href="module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29" class="RktStxLink" data-pltdoc="x">module</a></span> in a <a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase level</span></a>
that corresponds to <span class="RktVar">namespace</span>’s <a href="syntax-model.html#%28tech._base._phase%29" class="techoutside" data-pltdoc="x"><span class="techinside">base phase</span></a>,
then only that identifier is enriched.</p></li><li><p>For any other <span class="RktVar">top-level-form</span>,
<span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._namespace-syntax-introduce%29%29" class="RktValLink" data-pltdoc="x">namespace-syntax-introduce</a></span> is applied to the entire
syntax object.</p></li></ul><p>For interactive evaluation in the style of
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> and <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span>, wrap each expression
with <span class="RktSym">#%top-interaction</span>, which is normally bound to
<span class="RktSym"><a href="__top-interaction.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~23~25top-interaction%29%29" class="RktStxLink" data-pltdoc="x">#%top-interaction</a></span>, before passing it to <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</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._((quote._~23~25kernel)._eval-syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval-syntax%29%29" class="RktValDef RktValLink" data-pltdoc="x">eval-syntax</a></span></span><span class="hspace"> </span><span class="RktVar">stx</span><span class="hspace"> </span>[<span class="RktVar">namespace</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">stx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax~3f%29%29" class="RktValLink" data-pltdoc="x">syntax?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">namespace</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._namespace~3f%29%29" class="RktValLink" data-pltdoc="x">namespace?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._current-namespace%29%29" class="RktValLink" data-pltdoc="x">current-namespace</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</a></span>, except that <span class="RktVar">stx</span> must be a syntax object,
and its lexical context is not enriched before it is passed to the
<a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-load))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._non-empty-listof%29%29" class="RktValLink" data-pltdoc="x">non-empty-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="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="RktPn"> .</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">proc</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._non-empty-listof%29%29" class="RktValLink" data-pltdoc="x">non-empty-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="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="RktPn"> .</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current <a name="(tech._load._handler)"></a><span style="font-style: italic">load handler</span> to load
top-level forms from a file. The <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a> is called by
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValLink" data-pltdoc="x">load-relative</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fcd%29%29" class="RktValLink" data-pltdoc="x">load/cd</a></span>, and the
default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a>.</div></p><p>A load handler takes two arguments: a path (see <a href="pathutils.html" data-pltdoc="x">Paths</a>)
and an expected module name. The expected module name is a symbol or a
list when the call is to load a module declaration in response to a
<span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span> (in which case the file should contain a module
declaration), or <span class="RktVal">#f</span> for any other load.</p><p>When loading a module from a stream that starts with a compiled module
that contains submodules, the load handler should load only the
requested module, where a symbol as the load handler’s indicates the
root module and a list indicates a submodule whose path relative to
the root module is given by the <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cdr%29%29" class="RktValLink" data-pltdoc="x">cdr</a></span> of the list. The list
starts with <span class="RktVal">#f</span> when a submodule should be loaded <span style="font-style: italic">only</span>
if it can be loaded independently (i.e., from compiled form—<wbr></wbr>never
from source); if the submodule cannot be loaded independently, the
load handler should return without loading from a file. When the
expected module name is a list that starts with a symbol, the root
module and any other submodules can be loaded from the given file,
which might be from source, and the load handler still should not
complain if the expected submodule is not found.</p><p>The default load handler reads forms from the file in
<span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> mode with line-counting enabled for the file
port, unless the path has a <span class="RktVal">".zo"</span> suffix. It also
<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>s each read to set <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-compiled%29%29" class="RktValLink" data-pltdoc="x">read-accept-compiled</a></span>,
<span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-reader%29%29" class="RktValLink" data-pltdoc="x">read-accept-reader</a></span>, and <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-lang%29%29" class="RktValLink" data-pltdoc="x">read-accept-lang</a></span> to
<span class="RktVal">#t</span>. In addition, if <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-on-demand-enabled%29%29" class="RktValLink" data-pltdoc="x">load-on-demand-enabled</a></span> is
<span class="RktVal">#t</span>, then <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-on-demand-source%29%29" class="RktValLink" data-pltdoc="x">read-on-demand-source</a></span> is set to
the <a href="pathutils.html#%28tech._cleanse%29" class="techoutside" data-pltdoc="x"><span class="techinside">cleanse</span></a>d, absolute form of <span class="RktSym">path</span> during the
<span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> call. After reading a single form, the form is
passed to the current <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a>, wrapping the
evaluation in a continuation prompt (see
<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>) for the default continuation
prompt tag with handler that propagates the abort to the continuation
of the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span> call.</p><p>If the second argument to the load handler is a symbol, then:</p><ul><li><p>The <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> from the file is additionally
<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>d as follows (to provide consistent reading
of module source):</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._current-readtable%29%29" class="RktValLink" data-pltdoc="x">current-readtable</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-case-sensitive%29%29" class="RktValLink" data-pltdoc="x">read-case-sensitive</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-square-bracket-as-paren%29%29" class="RktValLink" data-pltdoc="x">read-square-bracket-as-paren</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-curly-brace-as-paren%29%29" class="RktValLink" data-pltdoc="x">read-curly-brace-as-paren</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-box%29%29" class="RktValLink" data-pltdoc="x">read-accept-box</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-compiled%29%29" class="RktValLink" data-pltdoc="x">read-accept-compiled</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-bar-quote%29%29" class="RktValLink" data-pltdoc="x">read-accept-bar-quote</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-graph%29%29" class="RktValLink" data-pltdoc="x">read-accept-graph</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-decimal-as-inexact%29%29" class="RktValLink" data-pltdoc="x">read-decimal-as-inexact</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-dot%29%29" class="RktValLink" data-pltdoc="x">read-accept-dot</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-infix-dot%29%29" class="RktValLink" data-pltdoc="x">read-accept-infix-dot</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-quasiquote%29%29" class="RktValLink" data-pltdoc="x">read-accept-quasiquote</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-reader%29%29" class="RktValLink" data-pltdoc="x">read-accept-reader</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-lang%29%29" class="RktValLink" data-pltdoc="x">read-accept-lang</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr></table></blockquote></li><li><p>If the read result is not a <span class="RktSym">module</span> form, or if a
second <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> does not produce an end-of-file,
then the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail%29%29" class="RktValLink" data-pltdoc="x">exn:fail</a></span> exception is raised without evaluating the form that
was read from the file. (In previous versions, the module
declaration was checked to match the name given as the second
argument to the load handler, but this check is no longer
performed.)</p></li><li><p>The <a href="syntax-model.html#%28tech._lexical._information%29" class="techoutside" data-pltdoc="x"><span class="techinside">lexical information</span></a> of the initial
<span class="RktSym">module</span> identifier is enriched with a binding for
<span class="RktSym"><a href="module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29" class="RktStxLink" data-pltdoc="x">module</a></span>, so that the form corresponds to a module
declaration independent of the current namespace’s bindings.</p></li></ul><p>If the second argument to the load handler is <span class="RktVal">#f</span>, then each
expression read from the file is wrapped with
<span class="RktSym">#%top-interaction</span>, which is normally bound to
<span class="RktSym"><a href="__top-interaction.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~23~25top-interaction%29%29" class="RktStxLink" data-pltdoc="x">#%top-interaction</a></span>, before passing it to the <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation
handler</span></a>.</p><p>The return value from the default <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a> is the value of
the last form from the loaded file, or <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a> if the file
contains no forms. If the given path is a relative path, then it is
resolved using the value of <span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</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._((quote._~23~25kernel)._load))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValDef RktValLink" data-pltdoc="x">load</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="finger.png" alt="+" width="24" height="24"/></span>See also <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=eval.html%23%2528part._namespaces%2529&version=6.7" class="Sq" data-pltdoc="x">Namespaces</a> in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=index.html&version=6.7" class="Sq" data-pltdoc="x"><span style="font-weight: bold">The Racket Guide</span></a>.</p></blockquote></blockquote></blockquote></div></p><p>Calls the current <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a> in tail position. The call is
<span class="RktSym">parameterized</span> to set <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span>
to the directory of <span class="RktVar">file</span>, which is resolved relative to
the value of <span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</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/private/misc..rkt)._load-relative))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValDef RktValLink" data-pltdoc="x">load-relative</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fuse-compiled%29%29" class="RktValLink" data-pltdoc="x">load/use-compiled</a></span>, but when <span class="RktVar">file</span> is a relative
path, it is resolved using the value of
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span> instead of the value of
<span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span> if the former is not <span class="RktVal">#f</span>, otherwise
<span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span> is used.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/misc..rkt)._load/cd))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fcd%29%29" class="RktValDef RktValLink" data-pltdoc="x">load/cd</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span>, but <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fcd%29%29" class="RktValLink" data-pltdoc="x">load/cd</a></span> sets both
<span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span> and
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span> before calling the <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load
handler</span></a>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-load-extension))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-extension%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load-extension</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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="RktVal">#f</span><span class="RktPn">)</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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-extension%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load-extension</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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="RktVal">#f</span><span class="RktPn">)</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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines a <a name="(tech._extension._load._handler)"></a><span style="font-style: italic">extension-load handler</span>, which is
called by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-extension%29%29" class="RktValLink" data-pltdoc="x">load-extension</a></span> and the default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load
handler</span></a>.</div></p><p>An <a href="#%28tech._extension._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">extension-load handler</span></a> takes the same arguments as a
<a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a>, but the file should be a platform-specific
<a name="(tech._dynamic._extension)"></a><span style="font-style: italic">dynamic extension</span>, typically with the file suffix
<span class="stt">".so"</span> (Unix), <span class="stt">".dll"</span> (Windows), or <span class="stt">".dylib"</span>
(Mac OS X). The file is loaded using internal, OS-specific
primitives. See <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=inside&rel=index.html&version=6.7" class="Sq" data-pltdoc="x">Inside: Racket C API</a> for more information on
<a href="#%28tech._dynamic._extension%29" class="techoutside" data-pltdoc="x"><span class="techinside">dynamic extensions</span></a>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._load-extension))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-extension%29%29" class="RktValDef RktValLink" data-pltdoc="x">load-extension</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Sets <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span> like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span>, and
calls the <a href="#%28tech._extension._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">extension-load handler</span></a> in tail position.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/misc..rkt)._load-relative-extension))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative-extension%29%29" class="RktValDef RktValLink" data-pltdoc="x">load-relative-extension</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-extension%29%29" class="RktValLink" data-pltdoc="x">load-extension</a></span>, but resolves <span class="RktVar">file</span> using
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span> like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValLink" data-pltdoc="x">load-relative</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-load/use-compiled))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%2Fuse-compiled%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load/use-compiled</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._non-empty-listof%29%29" class="RktValLink" data-pltdoc="x">non-empty-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="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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%2Fuse-compiled%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load/use-compiled</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">proc</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="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><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._non-empty-listof%29%29" class="RktValLink" data-pltdoc="x">non-empty-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="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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current <a name="(tech._compiled._load._handler)"></a><span style="font-style: italic">compiled-load
handler</span> to load from a file that may have a compiled form. The
<a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> is called by <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fuse-compiled%29%29" class="RktValLink" data-pltdoc="x">load/use-compiled</a></span>.</div></p><p>The protocol for a <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> is the same as for the
<a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a> (see <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%29%29" class="RktValLink" data-pltdoc="x">current-load</a></span>), except that a
<a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> is expected to set
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span> itself. The default
<a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a>, however, checks for a <span class="stt">".ss"</span>
file when the given path ends with <span class="stt">".rkt"</span>, no <span class="stt">".rkt"</span>
file exists, and when the handler’s second argument is a symbol. In
addition, the default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> checks for
<span class="stt">".zo"</span> (bytecode) files and <span class="stt">".so"</span> (native Unix),
<span class="stt">".dll"</span> (native Windows), or <span class="stt">".dylib"</span> (native Mac OS
X) files.</p><p>The check for a compiled file occurs whenever the given path
<span class="RktVar">file</span> ends with any extension (e.g., <span class="stt">".rkt"</span> or
<span class="stt">".scrbl"</span>), and the check consults the subdirectories
indicated by the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-compiled-file-roots%29%29" class="RktValLink" data-pltdoc="x">current-compiled-file-roots</a></span> and
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="RktValLink" data-pltdoc="x">use-compiled-file-paths</a></span> parameters relative to
<span class="RktVar">file</span>, where the former supplies “roots” for compiled files
and the latter provides subdirectories.
<span class="refelem"><span class="refcolumn"><span class="refcontent">See also <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=raco&rel=api_compile-path.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">compiler/compilation-path</span></a>.</span></span></span>
A “root” can be an absolute
path, in which case <span class="RktVar">file</span>’s directory is combined with
<span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._reroot-path%29%29" class="RktValLink" data-pltdoc="x">reroot-path</a></span> and the root as the second argument; if the
“root” is a relative path, then the relative path is instead
suffixed onto the directory of <span class="RktVar">file</span>. The roots are tried in
order, and the subdirectories are checked in order within each root. A
<span class="stt">".zo"</span> version of the file (whose name is formed by passing
<span class="RktVar">file</span> and <span class="RktVal">#".zo"</span> to <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-add-suffix%29%29" class="RktValLink" data-pltdoc="x">path-add-suffix</a></span>) is
loaded if it exists directly in one of the indicated subdirectories,
or a <span class="stt">".so"</span>/<span class="stt">".dll"</span>/<span class="stt">".dylib"</span> version of the
file is loaded if it exists within a <span class="stt">"native"</span> subdirectory of
a <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="RktValLink" data-pltdoc="x">use-compiled-file-paths</a></span> directory, in an even deeper
subdirectory as named by <span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-library-subpath%29%29" class="RktValLink" data-pltdoc="x">system-library-subpath</a></span>. A compiled
file is loaded only if it checks out according to
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-check%29%29" class="RktValLink" data-pltdoc="x">use-compiled-file-check</a></span><span class="RktPn">)</span>; with the default parameter value
of <span class="RktVal">'</span><span class="RktVal">modify-seconds</span>, a compiled file is used only if its
modification date is not older than the
date for <span class="RktVar">file</span>. If both <span class="stt">".zo"</span> and
<span class="stt">".so"</span>/<span class="stt">".dll"</span>/<span class="stt">".dylib"</span> files are available,
the <span class="stt">".so"</span>/<span class="stt">".dll"</span>/<span class="stt">".dylib"</span> file is used. If
<span class="RktVar">file</span> ends with <span class="stt">".rkt"</span>, no such file exists, the
handler’s second argument is a symbol, and a <span class="stt">".ss"</span> file
exists, then <span class="stt">".zo"</span> and
<span class="stt">".so"</span>/<span class="stt">".dll"</span>/<span class="stt">".dylib"</span> files are used only
with names based on <span class="RktVar">file</span> with its suffixed replaced by
<span class="stt">".ss"</span>.</p><p>While a <span class="stt">".zo"</span>, <span class="stt">".so"</span>, <span class="stt">".dll"</span>, or
<span class="stt">".dylib"</span> file is loaded, the current <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValLink" data-pltdoc="x">load-relative</a></span>
directory is set to the directory of the original <span class="RktVar">file</span>. If
the file to be loaded has the suffix <span class="stt">".ss"</span> while the
requested file has the suffix <span class="stt">".rkt"</span>, then the
<span class="RktSym"><a href="Module_Names_and_Loading.html#%28def._%28%28quote._~23~25kernel%29._current-module-declare-source%29%29" class="RktValLink" data-pltdoc="x">current-module-declare-source</a></span> parameter is set to the full
path of the loaded file, otherwise the
<span class="RktSym"><a href="Module_Names_and_Loading.html#%28def._%28%28quote._~23~25kernel%29._current-module-declare-source%29%29" class="RktValLink" data-pltdoc="x">current-module-declare-source</a></span> parameter is set to
<span class="RktVal">#f</span>.</p><p>If the original <span class="RktVar">file</span> is loaded or a <span class="stt">".zo"</span> variant is
loaded, the <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a> is called to load the file. If any
other kind of file is loaded, the <a href="#%28tech._extension._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">extension-load handler</span></a> is
called.</p><p>When the default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> loads a module from a
bytecode (i.e., <span class="stt">".zo"</span>) file, the handler records the bytecode
file path in the current namespace’s <a href="syntax-model.html#%28tech._module._registry%29" class="techoutside" data-pltdoc="x"><span class="techinside">module registry</span></a>. More
specifically, the handler records the path for the top-level module of
the loaded module, which is an enclosing module if the loaded module
is a submodule. Thereafter, loads via the default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load
handler</span></a> for modules within the same top-level module use the recorded
file, independent of the file that otherwise would be selected by the
<a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> (e.g., even if the
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="RktValLink" data-pltdoc="x">use-compiled-file-paths</a></span> parameter value changes). The default
<a href="Module_Names_and_Loading.html#%28tech._module._name._resolver%29" class="techoutside" data-pltdoc="x"><span class="techinside">module name resolver</span></a> transfers bytecode-file information when a
module declaration is attached to a new namespace. This protocol supports
independent but consistent loading of submodules from bytecode files.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/misc..rkt)._load/use-compiled))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load%2Fuse-compiled%29%29" class="RktValDef RktValLink" data-pltdoc="x">load/use-compiled</a></span></span><span class="hspace"> </span><span class="RktVar">file</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Calls the current <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> in tail position.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-load-relative-directory))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load-relative-directory</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._complete-path~3f%29%29" class="RktValLink" data-pltdoc="x">complete-path?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-load-relative-directory</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._complete-path~3f%29%29" class="RktValLink" data-pltdoc="x">complete-path?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that is set by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load%29%29" class="RktValLink" data-pltdoc="x">load</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValLink" data-pltdoc="x">load-relative</a></span>,
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-extension%29%29" class="RktValLink" data-pltdoc="x">load-extension</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative-extension%29%29" class="RktValLink" data-pltdoc="x">load-relative-extension</a></span>, and the
default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a>, and used by
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative%29%29" class="RktValLink" data-pltdoc="x">load-relative</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._load-relative-extension%29%29" class="RktValLink" data-pltdoc="x">load-relative-extension</a></span>, and the
default <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a>.</div></p><p>When a new path or string is provided as the parameter’s value, it is
immediately expanded (see <a href="pathutils.html" data-pltdoc="x">Paths</a>) and converted to a
path. (The directory need not exist.)</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._use-compiled-file-paths))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="RktValDef RktValLink" data-pltdoc="x">use-compiled-file-paths</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._relative-path~3f%29%29" class="RktValLink" data-pltdoc="x">relative-path?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29" class="RktValDef RktValLink" data-pltdoc="x">use-compiled-file-paths</a></span></span><span class="hspace"> </span><span class="RktVar">paths</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">paths</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._relative-path~3f%29%29" class="RktValLink" data-pltdoc="x">relative-path?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A list of relative paths, which defaults to <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._string-~3epath%29%29" class="RktValLink" data-pltdoc="x">string->path</a></span><span class="stt"> </span><span class="RktVal">"compiled"</span><span class="RktPn">)</span><span class="RktPn">)</span>. It is used by the <a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load
handler</span></a> (see <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%2Fuse-compiled%29%29" class="RktValLink" data-pltdoc="x">current-load/use-compiled</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-compiled-file-roots))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-compiled-file-roots%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-compiled-file-roots</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">same</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-compiled-file-roots%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-compiled-file-roots</a></span></span><span class="hspace"> </span><span class="RktVar">paths</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">paths</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">same</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A list of paths and <span class="RktVal">'</span><span class="RktVal">same</span>s that is is used by the default
<a href="#%28tech._compiled._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compiled-load handler</span></a> (see <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%2Fuse-compiled%29%29" class="RktValLink" data-pltdoc="x">current-load/use-compiled</a></span>).</div></p><p>The parameter is normally initialized to <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">same</span><span class="RktPn">)</span>, but
the parameter’s initial value can be adjusted by the
<a name="(idx._(gentag._243._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLTCOMPILEDROOTS</span> environment variable or the
<span class="nobreak"><span class="stt">--compiled</span></span> or <span class="nobreak"><span class="stt">-R</span></span> command-line flag for <span class="stt">racket</span>. If
the environment variable is defined and not overridden by a
command-line flag, it is parsed by first replacing any
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">@(version)</span><span class="hspace"></span></span> with the result of <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._version%29%29" class="RktValLink" data-pltdoc="x">version</a></span><span class="RktPn">)</span>, then using
<span class="RktSym"><a href="Filesystem.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-list-string-~3epath-list%29%29" class="RktValLink" data-pltdoc="x">path-list-string->path-list</a></span> with a default path list
<span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29" class="RktValLink" data-pltdoc="x">build-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">same</span><span class="RktPn">)</span><span class="RktPn">)</span> to arrive at the parameter’s
initial value.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._use-compiled-file-check))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-check%29%29" class="RktValDef RktValLink" data-pltdoc="x">use-compiled-file-check</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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">'</span><span class="RktVal">modify-seconds</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exists</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-check%29%29" class="RktValDef RktValLink" data-pltdoc="x">use-compiled-file-check</a></span></span><span class="hspace"> </span><span class="RktVar">check</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">check</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%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">'</span><span class="RktVal">modify-seconds</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exists</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines how a compiled file is checked
against its source to enable use of the compiled file. By default, the
file-check mode is <span class="RktVal">'</span><span class="RktVal">modify-seconds</span>, which uses a compiled
file when its filesystem modification date is at least as new as the
source file’s. The <span class="RktVal">'</span><span class="RktVal">exists</span> mode causes a compiled file to be
used in place of its source as long as the compiled file exists.</div></p><p>If the <a name="(idx._(gentag._244._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLT_COMPILED_FILE_CHECK</span> environment variable is
set to <span class="RktInBG"><span class="hspace"></span><span class="RktIn">modify-seconds</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">exists</span><span class="hspace"></span></span>, then the
environment variable’s value configures the parameter when Racket
starts.</p><p class="SHistory">Added in version 6.6.0.3 of package <span class="stt">base</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/private/misc..rkt)._read-eval-print-loop))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-eval-print-loop</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Starts a new <a name="(tech._repl)"></a><span style="font-style: italic">REPL</span> using the current input, output, and error
ports. The REPL wraps each expression to evaluate with
<span class="RktSym">#%top-interaction</span>, which is normally bound to
<span class="RktSym"><a href="__top-interaction.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~23~25top-interaction%29%29" class="RktStxLink" data-pltdoc="x">#%top-interaction</a></span>, and it wraps each evaluation with a
continuation prompt using the default continuation prompt tag and
prompt handler (see <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>). The REPL
also wraps the read and print operations with a prompt for the default
tag whose handler ignores abort arguments and continues the loop. The
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> procedure does not return until
<span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._eof%29%29" class="RktValLink" data-pltdoc="x">eof</a></span> is read, at which point it returns <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a>.</div></p><p>The <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> procedure can be configured through
the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-prompt-read%29%29" class="RktValLink" data-pltdoc="x">current-prompt-read</a></span>, <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-eval%29%29" class="RktValLink" data-pltdoc="x">current-eval</a></span>, and
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-print%29%29" class="RktValLink" data-pltdoc="x">current-print</a></span> parameters.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-prompt-read))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-prompt-read%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-prompt-read</a></span></span><span class="RktPn"></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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-prompt-read%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-prompt-read</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines a <a name="(tech._prompt._read._handler)"></a><span style="font-style: italic">prompt read handler</span>, which is
a procedure that takes no arguments, displays a prompt string, and
returns a top-level form to evaluate. The prompt read handler is
called by <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span>, and after printing a prompt,
the handler typically should call the <a href="#%28tech._read._interaction._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">read interaction handler</span></a>
(as determined by the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-read-interaction%29%29" class="RktValLink" data-pltdoc="x">current-read-interaction</a></span> parameter)
with the port produced by the <a href="#%28tech._interaction._port._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">interaction port handler</span></a>
(as determined by the <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-get-interaction-input-port%29%29" class="RktValLink" data-pltdoc="x">current-get-interaction-input-port</a></span> parameter).</div></p><p>The default prompt read handler prints <span class="RktInBG"><span class="hspace"></span><span class="RktIn">></span><span class="hspace"> </span></span> and returns the
result of</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><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">in</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-get-interaction-input-port%29%29" class="RktValLink" data-pltdoc="x">current-get-interaction-input-port</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-read-interaction%29%29" class="RktValLink" data-pltdoc="x">current-read-interaction</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="inspectors.html#%28def._%28%28quote._~23~25kernel%29._object-name%29%29" class="RktValLink" data-pltdoc="x">object-name</a></span><span class="hspace"> </span><span class="RktSym">in</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">in</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>If the input and output ports are both terminals (in the sense of
<span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._terminal-port~3f%29%29" class="RktValLink" data-pltdoc="x">terminal-port?</a></span>) and if the output port appears to be counting
lines (because <span class="RktSym"><a href="linecol.html#%28def._%28%28quote._~23~25kernel%29._port-next-location%29%29" class="RktValLink" data-pltdoc="x">port-next-location</a></span> returns a non-<span class="RktVal">#f</span>
line and column), then the output port’s line is incremented and its
column is reset to <span class="RktVal">0</span> via <span class="RktSym"><a href="linecol.html#%28def._%28%28quote._~23~25kernel%29._set-port-next-location%21%29%29" class="RktValLink" data-pltdoc="x">set-port-next-location!</a></span>
before returning the read result.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-get-interaction-input-port))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-get-interaction-input-port%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-get-interaction-input-port</a></span></span><span class="RktPn"></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="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-get-interaction-input-port%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-get-interaction-input-port</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</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="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the <a name="(tech._interaction._port._handler)"></a><span style="font-style: italic">interaction port handler</span>,
which returns a port to use for <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> inputs.</div></p><p>The default interaction port handler returns the current input port.
In addition, if that port is the initial current input port,
the initial current output and error ports are flushed.</p><p>The <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=gui&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/gui/base</span></a> library adjusts this parameter’s
value by extending the current value. The extension wraps the result
port so that GUI events can be handled when reading from the port
blocks.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-read-interaction))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-read-interaction%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-read-interaction</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="hspace"> </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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-read-interaction%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-read-interaction</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="hspace"> </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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current <a name="(tech._read._interaction._handler)"></a><span style="font-style: italic">read interaction
handler</span>, which is procedure that takes an arbitrary value and an
input port and returns an expression read from the input port.</div></p><p>The default read interaction handler accepts <span class="RktVar">src</span> and
<span class="RktVar">in</span> and returns</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><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"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-reader%29%29" class="RktValLink" data-pltdoc="x">read-accept-reader</a></span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-accept-lang%29%29" class="RktValLink" data-pltdoc="x">read-accept-lang</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span><span class="hspace"> </span><span class="RktVar">src</span><span class="hspace"> </span><span class="RktVar">in</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-print))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-print%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-print</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-print%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-print</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </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="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the <a name="(tech._print._handler)"></a><span style="font-style: italic">print handler</span> that is called
by <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._read-eval-print-loop%29%29" class="RktValLink" data-pltdoc="x">read-eval-print-loop</a></span> to print the result of an evaluation
(and the result is ignored).</div></p><p>The default <a href="#%28tech._print._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">print handler</span></a> <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._print%29%29" class="RktValLink" data-pltdoc="x">print</a></span>s the value to the
current output port (as determined by the
<span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._current-output-port%29%29" class="RktValLink" data-pltdoc="x">current-output-port</a></span> parameter) and then outputs a newline,
except that it prints nothing when the value is <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-compile))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-compile%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-compile</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><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">. </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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-compile%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-compile</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><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">. </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="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current <a name="(tech._compilation._handler)"></a><span style="font-style: italic">compilation handler</span>.
The <a href="#%28tech._compilation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compilation handler</span></a> is a procedure that takes a top-level form and
returns a compiled form; see <a href="syntax-model.html#%28part._compilation-model%29" data-pltdoc="x">Compilation</a> for
more information on compilation.</div></p><p>The <a href="#%28tech._compilation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compilation handler</span></a> is called by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile%29%29" class="RktValLink" data-pltdoc="x">compile</a></span>, and
indirectly by the default <a href="#%28tech._evaluation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">evaluation handler</span></a> and the default
<a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a>.</p><p>The handler’s second argument is <span class="RktVal">#t</span> if the compiled form will
be used only for immediate evaluation, or <span class="RktVal">#f</span> if the compiled
form may be saved for later use; the default compilation handler is
optimized for the special case of immediate evaluation.</p><p>When a compiled form is written to an output port, the written form
starts with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#~</span><span class="hspace"></span></span>. See <a href="printing.html#%28part._print-compiled%29" data-pltdoc="x">Printing Compiled Code</a> for more
information.</p><p>For internal testing purposes, when the
<a name="(idx._(gentag._245._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLT_VALIDATE_COMPILE</span> environment variable is set,
the default compilation handler runs a bytecode validator immediately
on its own compilation results (instead of relying only on validation
when compiled bytecode is loaded).</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._((quote._~23~25kernel)._compile))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile</a></span></span><span class="hspace"> </span><span class="RktVar">top-level-form</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">top-level-form</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval%29%29" class="RktValLink" data-pltdoc="x">eval</a></span>, but calls the current <a href="#%28tech._compilation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compilation handler</span></a> in
tail position with <span class="RktVar">top-level-form</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._((quote._~23~25kernel)._compile-syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-syntax%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-syntax</a></span></span><span class="hspace"> </span><span class="RktVar">stx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">stx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax~3f%29%29" class="RktValLink" data-pltdoc="x">syntax?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval-syntax%29%29" class="RktValLink" data-pltdoc="x">eval-syntax</a></span>, but calls the current <a href="#%28tech._compilation._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">compilation
handler</span></a> in tail position with <span class="RktVar">stx</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._((quote._~23~25kernel)._compiled-expression-recompile))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression-recompile%29%29" class="RktValDef RktValLink" data-pltdoc="x">compiled-expression-recompile</a></span></span><span class="hspace"> </span><span class="RktVar">ce</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">ce</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValLink" data-pltdoc="x">compiled-expression?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Recompiles <span class="RktVar">ce</span>, effectively re-running optimization passes to
produce an equivalent compiled form with potentially different
performance characteristics.</div></p><p>If <span class="RktVar">ce</span> includes module forms, then only phase-0 code in the
immediate module (not in submodules) is recompiled.</p><p class="SHistory">Added in version 6.3 of package <span class="stt">base</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._((quote._~23~25kernel)._compiled-expression~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compiled-expression~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">compiled-expression?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a compiled form, <span class="RktVal">#f</span>
otherwise.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._compile-enforce-module-constants))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-enforce-module-constants%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-enforce-module-constants</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-enforce-module-constants%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-enforce-module-constants</a></span></span><span class="hspace"> </span><span class="RktVar">on?</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">on?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines how a module declaration is compiled.</div></p><p>When constants are enforced, and when the macro-expanded body of a
module contains no <span class="RktSym"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> assignment to a particular variable
defined within the module, then the variable is marked as constant
when the definition is evaluated. Afterward, the variable’s value
cannot be assigned or undefined through <span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._module-~3enamespace%29%29" class="RktValLink" data-pltdoc="x">module->namespace</a></span>,
and it cannot be defined by redeclaring the module.</p><p>Enforcing constants allows the compiler to inline some variable
values, and it allows the native-code just-in-time compiler to
generate code that skips certain run-time checks.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._compile-allow-set!-undefined))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-allow-set%21-undefined%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-allow-set!-undefined</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-allow-set%21-undefined%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-allow-set!-undefined</a></span></span><span class="hspace"> </span><span class="RktVar">allow?</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">allow?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines how a <span class="RktSym"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> expression is compiled
when it mutates a global variable. If the value of this parameter is a
true value, <span class="RktSym"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> expressions for global variables are
compiled so that the global variable is set even if it was not
previously defined. Otherwise, <span class="RktSym"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> expressions for global
variables are compiled to raise the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract~3avariable%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract:variable</a></span> exception if the global variable
is not defined at the time the <span class="RktSym"><a href="set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> is performed. Note that
this parameter is used when an expression is <span style="font-style: italic">compiled</span>, not
when it is <span style="font-style: italic">evaluated</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._compile-context-preservation-enabled))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-context-preservation-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-context-preservation-enabled</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._compile-context-preservation-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">compile-context-preservation-enabled</a></span></span><span class="hspace"> </span><span class="RktVar">on?</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">on?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines whether compilation should avoid
function-call inlining and other optimizations that may cause
information to be lost from stack traces (as reported by
<span class="RktSym"><a href="contmarks.html#%28def._%28%28quote._~23~25kernel%29._continuation-mark-set-~3econtext%29%29" class="RktValLink" data-pltdoc="x">continuation-mark-set->context</a></span>). The default is <span class="RktVal">#f</span>,
which allows such optimizations.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._eval-jit-enabled))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval-jit-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">eval-jit-enabled</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._eval-jit-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">eval-jit-enabled</a></span></span><span class="hspace"> </span><span class="RktVar">on?</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">on?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="finger.png" alt="+" width="24" height="24"/></span>See also <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=performance.html%23%2528part._.J.I.T%2529&version=6.7" class="Sq" data-pltdoc="x">The Bytecode and Just-in-Time (JIT) Compilers</a> in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=index.html&version=6.7" class="Sq" data-pltdoc="x"><span style="font-weight: bold">The Racket Guide</span></a>.</p></blockquote></blockquote></blockquote></div></p><p>A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines whether the native-code just-in-time
compiler (<a name="(tech._jit)"></a><span style="font-style: italic">JIT</span>) is enabled for code (compiled or not) that is passed to
the default evaluation handler. A true parameter value is effective
only on platforms for which the JIT is supported, and changing the value
from its initial setting affects only forms that are outside of <span class="RktSym"><a href="module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29" class="RktStxLink" data-pltdoc="x">module</a></span>.</p><p>The default is <span class="RktVal">#t</span>, unless the JIT is not supported by the
current platform, unless it is disabled through the
<span class="nobreak"><span class="stt">-j</span></span>/<span class="nobreak"><span class="stt">--no-jit</span></span> command-line flag to stand-alone Racket (or
GRacket), and unless it is disabled through the
<a name="(idx._(gentag._246._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLTNOMZJIT</span> environment variable (set to any
value).</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._load-on-demand-enabled))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-on-demand-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">load-on-demand-enabled</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._load-on-demand-enabled%29%29" class="RktValDef RktValLink" data-pltdoc="x">load-on-demand-enabled</a></span></span><span class="hspace"> </span><span class="RktVar">on?</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">on?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines whether the default <a href="#%28tech._load._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">load handler</span></a>
sets <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-on-demand-source%29%29" class="RktValLink" data-pltdoc="x">read-on-demand-source</a></span>. See <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-load%29%29" class="RktValLink" data-pltdoc="x">current-load</a></span> for
more information. The default is <span class="RktVal">#t</span>, unless it is disabled
through the <span class="nobreak"><span class="stt">-d</span></span>/<span class="nobreak"><span class="stt">--no-delay</span></span> command-line flag.</div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="Namespaces.html" title="backward to "14.1 Namespaces"" data-pltdoc="x">← prev</a> <a href="security.html" title="up to "14 Reflection and Security"" data-pltdoc="x">up</a> <a href="load-lang.html" title="forward to "14.3 The racket/load Language"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|