/usr/share/doc/racket/xrepl/index.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 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 | <!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>XREPL: eXtended REPL</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="" class="tocviewselflink" data-pltdoc="x">XREPL:<span class="mywbr"> </span> e<span class="mywbr"> </span>Xtended REPL</a></td></tr></table></div><div class="tocviewsublistonly" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="#%28part._.Installing_.X.R.E.P.L%29" class="tocviewlink" data-pltdoc="x">Installing XREPL</a></td></tr><tr><td align="right">2 </td><td><a href="#%28part._.Meta_.R.E.P.L_.Commands%29" class="tocviewlink" data-pltdoc="x">Meta REPL Commands</a></td></tr><tr><td align="right">3 </td><td><a href="#%28part._past-vals%29" class="tocviewlink" data-pltdoc="x">Past Evaluation Results</a></td></tr><tr><td align="right">4 </td><td><a href="#%28part._.Hacking_.X.R.E.P.L%29" class="tocviewlink" data-pltdoc="x">Hacking XREPL</a></td></tr><tr><td align="right">5 </td><td><a href="#%28part._.License_.Issues%29" class="tocviewlink" data-pltdoc="x">License Issues</a></td></tr></table></div></div></div><div class="tocsub"><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber"></span><a href="#%28part._top%29" class="tocsubseclink" data-pltdoc="x">XREPL:<span class="mywbr"> </span> e<span class="mywbr"> </span>Xtended REPL</a></td></tr><tr><td><span class="tocsublinknumber">1<tt> </tt></span><a href="#%28part._.Installing_.X.R.E.P.L%29" class="tocsubseclink" data-pltdoc="x">Installing XREPL</a></td></tr><tr><td><span class="tocsublinknumber">2<tt> </tt></span><a href="#%28part._.Meta_.R.E.P.L_.Commands%29" class="tocsubseclink" data-pltdoc="x">Meta REPL Commands</a></td></tr><tr><td><span class="tocsublinknumber">2.1<tt> </tt></span><a href="#%28part._.Generic_.Commands%29" class="tocsubseclink" data-pltdoc="x">Generic Commands</a></td></tr><tr><td><a href="#%28xrepl._help%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,help</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._exit%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,exit</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._cd%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,cd</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._pwd%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,pwd</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._shell%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,shell</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._edit%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,edit</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._drracket%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,drracket</span><span class="hspace"></span></span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.2<tt> </tt></span><a href="#%28part._.Binding_.Information%29" class="tocsubseclink" data-pltdoc="x">Binding Information</a></td></tr><tr><td><a href="#%28xrepl._apropos%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,apropos</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._describe%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,describe</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._doc%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,doc</span><span class="hspace"></span></span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.3<tt> </tt></span><a href="#%28part._.Requiring_and_.Loading_.Files%29" class="tocsubseclink" data-pltdoc="x">Requiring and Loading Files</a></td></tr><tr><td><a href="#%28xrepl._require%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._require-reloadable%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require-<wbr></wbr>reloadable</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._enter%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,enter</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._toplevel%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,toplevel</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._load%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,load</span><span class="hspace"></span></span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.4<tt> </tt></span><a href="#%28part._.Debugging%29" class="tocsubseclink" data-pltdoc="x">Debugging</a></td></tr><tr><td><a href="#%28xrepl._backtrace%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,backtrace</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._time%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,time</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._trace%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,trace</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._untrace%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,untrace</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._errortrace%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errortrace</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._profile%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,profile</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._execution-counts%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,execution-<wbr></wbr>counts</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._coverage%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,coverage</span><span class="hspace"></span></span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.5<tt> </tt></span><a href="#%28part._.Miscellaneous_.Commands%29" class="tocsubseclink" data-pltdoc="x">Miscellaneous Commands</a></td></tr><tr><td><a href="#%28xrepl._switch-namespace%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch-<wbr></wbr>namespace</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._syntax%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,syntax</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._check-requires%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,check-<wbr></wbr>requires</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._log%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,log</span><span class="hspace"></span></span></span></a></td></tr><tr><td><a href="#%28xrepl._install%21%29" class="tocsubnonseclink" data-pltdoc="x"><span class="plainlink"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,install!</span><span class="hspace"></span></span></span></a></td></tr><tr><td><span class="tocsublinknumber">3<tt> </tt></span><a href="#%28part._past-vals%29" class="tocsubseclink" data-pltdoc="x">Past Evaluation Results</a></td></tr><tr><td><span class="tocsublinknumber">4<tt> </tt></span><a href="#%28part._.Hacking_.X.R.E.P.L%29" class="tocsubseclink" data-pltdoc="x">Hacking XREPL</a></td></tr><tr><td><span class="tocsublinknumber">5<tt> </tt></span><a href="#%28part._.License_.Issues%29" class="tocsubseclink" data-pltdoc="x">License Issues</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.1</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <span class="nonavigation">← prev</span> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">up</a> <span class="nonavigation">next →</span></span> </div><h2 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""top""><a name="(part._top)"></a><a name="(part._.X.R.E.P.L__e.Xtended_.R.E.P.L)"></a><a name="(mod-path._xrepl)"></a>XREPL: eXtended REPL</h2><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Eli Barzilay <<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>></p></span></div><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">xrepl</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">xrepl-lib</span></span></td></tr></table></div><div class="SIntrapara">Loading the <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">xrepl</span></a> library enables XREPL, which extends
the <span class="stt">racket</span> <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=intro.html%23%2528tech._repl%2529&version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">REPL</span></a> significantly, turning it
into a more useful tool for interactive exploration and development.
Additions include “meta commands,” using readline, keeping past
evaluation results, and more.</div></p><h3 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Installing_XREPL"">1<tt> </tt><a name="(part._.Installing_.X.R.E.P.L)"></a>Installing XREPL</h3><p><div class="SIntrapara">To use XREPL, start <span class="stt">racket</span> and enter <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktSym">xrepl</span><span class="RktPn">)</span>.
You will know that it works when the prompt changes to a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-></span><span class="hspace"></span></span>,
and, if you’re working on a capable terminal, you will now have readline
editing. You can also start <span class="stt">racket</span> and ask for XREPL to be
loaded using command-line arguments:
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">racket -il xrepl</span></div></p><p>If you want to enable XREPL automatically, add this expression to your
Racket initialization file.
<span class="refelem"><span class="refcolumn"><span class="refcontent">To load XREPL conditionally (e.g., not in older Racket
versions), you can use <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Module_Names_and_Loading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._dynamic-require%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">dynamic-require</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">xrepl</span><span class="stt"> </span><span class="RktVal">#f</span><span class="RktPn">)</span>. This
is a plain expression that can be placed inside <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=when_unless.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._when%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">when</a></span> and
elsewhere.</span></span></span>
An easy way to do the necessary editing is to enter <a href="#%28xrepl._install%21%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,install!</span><span class="hspace"></span></span></a>,
which will inspect and edit your initialization file (it will describe
the change and ask for your permission). Alternatively, you can edit
the file directly: on Unix, it is <span class="stt">"~/.racketrc"</span>, and for
other platforms evaluate <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._find-system-path%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">init-file</span><span class="RktPn">)</span> to see
where it is.</p><p>XREPL will set up a readline-based reader, so you do not need to load
that yourself. If your initialization file was previously set to load
readline via <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=readline&rel=index.html%23%2528def._%2528%2528lib._readline%252Fmain..rkt%2529._install-readline%2521%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">install-readline!</a></span>, the <a href="#%28xrepl._install%21%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,install!</span><span class="hspace"></span></span></a> command
will (notify you and) remove it. If you added it yourself, consider
removing it. (This is not strictly needed, but XREPL is slightly
better at detecting when to use readline.)</p><h3 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Meta_REPL_Commands"">2<tt> </tt><a name="(part._.Meta_.R.E.P.L_.Commands)"></a>Meta REPL Commands</h3><p>Most of the XREPL extensions are implemented as meta commands. These
commands are entered at the REPL, prefixed by a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,</span><span class="hspace"></span></span> and followed
by the command name. Note that several commands correspond directly to
Racket functions (e.g., <a href="#%28xrepl._exit%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,exit</span><span class="hspace"></span></span></a>) —<wbr></wbr> but since they work outside of
your REPL, they can be used even if the matching bindings are not
available.</p><h4 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Generic_Commands"">2.1<tt> </tt><a name="(part._.Generic_.Commands)"></a>Generic Commands</h4><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._help)"></a><a href="#%28xrepl._help%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,help</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<command-name>]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">display available commands</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,h</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,?</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Without an argument, displays a list of all known commands. Specify a
command to get help specific to that command.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._exit)"></a><a href="#%28xrepl._exit%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,exit</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<exit-code>]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">exit racket</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,quit</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,ex</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Exits Racket, optionally with an error code (see <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Exiting.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exit%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">exit</a></span>).</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._cd)"></a><a href="#%28xrepl._cd%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,cd</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<path>]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">change the current directory</span></p></td></tr></table></p><p>Sets the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-directory%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">current-directory</a></span> to the given path. If no path is
specified, use your home directory. Path arguments are passed through
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._expand-user-path%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">expand-user-path</a></span> so you can use <span class="RktInBG"><span class="hspace"></span><span class="RktIn">~</span><span class="hspace"></span></span>. An argument of
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> means “the previous path”.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._pwd)"></a><a href="#%28xrepl._pwd%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,pwd</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">display the current directory</span></p></td></tr></table></p><p>Reports the value of <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-directory%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">current-directory</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._shell)"></a><a href="#%28xrepl._shell%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,shell</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><shell-command></span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">run a shell command</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,sh</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,ls</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,cp</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,mv</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,rm</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,md</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,rd</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,git</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,svn</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Use <a href="#%28xrepl._shell%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,shell</span><span class="hspace"></span></span></a> (or <a href="#%28xrepl._shell%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,sh</span><span class="hspace"></span></span></a>) to run a generic shell command (via
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528lib._racket%252Fsystem..rkt%2529._system%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">system</a></span>). For convenience, a few synonyms are provided —<wbr></wbr>
they run the specified executables (still using <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528lib._racket%252Fsystem..rkt%2529._system%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">system</a></span>).</p><p>When the REPL is in the context of a module with a known source file,
the shell command can use the <span class="stt">F</span> environment variable as the
path to the file. Otherwise, <span class="stt">F</span> is set to an empty string.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._edit)"></a><a href="#%28xrepl._edit%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,edit</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><file> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">edit files in your $EDITOR</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,e</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Runs an editor, as specified by your <span class="stt">EDITOR</span> environment
variable, with the given file/s arguments. If no files are specified
and the REPL is currently inside a module’s namespace, then the file
for that module is used. If the <span class="stt">EDITOR</span> environment variable
is not set, use the <a href="#%28xrepl._drracket%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,drracket</span><span class="hspace"></span></span></a> command instead.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._drracket)"></a><a href="#%28xrepl._drracket%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,drracket</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[-flag] <file> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">edit files in DrRacket</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,dr</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,drr</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Runs DrRacket with the specified file/s. If no files are given, and
the REPL is currently inside a module, the file for that module is
used.</p><p>DrRacket is launched directly, without starting a new subprocess, and
it is then kept running in a hidden window so further invocations are
immediate. (When this command is used for the first time, you will
see DrRacket start as usual, and then its window will disappear —<wbr></wbr>
that window is keeping DrRacket ready for quick editing.)</p><p><div class="SIntrapara">In addition to file arguments, arguments can specify one of a few
flags for additional operations:
</div><div class="SIntrapara"><ul><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-new</span><span class="hspace"></span></span>: opens a new editing window. This is the default
when no files are given and the REPL is not inside a module,</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-open</span><span class="hspace"></span></span>: opens the specified file/s (or the current
module’s file). This is the default when files are given or when
inside a module.</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-quit</span><span class="hspace"></span></span>: exits the running DrRacket instance. Quitting
DrRacket is usually not necessary. Therefore, if you try to quit it
from the DrRacket window, it will instead just close the window but
DrRacket will still be running in the background. Use this command
in case there is some exceptional problem that requires actually
quitting the IDE. (Once you do so, future uses of this command will
start a fresh instance.)</p></li></ul></div></p><h4 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Binding_Information"">2.2<tt> </tt><a name="(part._.Binding_.Information)"></a>Binding Information</h4><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._apropos)"></a><a href="#%28xrepl._apropos%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,apropos</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><search-for> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">look for a binding</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,ap</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Searches for known bindings in the current namespace. The arguments
specify which binding to look for: use a symbol (without a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">'</span><span class="hspace"></span></span>) to look for bindings that contain that name, and use a
regexp (e.g., <span class="RktVal">#rx"..."</span>) to use a regexp for the search.
Multiple arguments are and-ed together.</p><p>If no arguments are given, <span style="font-style: italic">all</span> bindings are listed.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._describe)"></a><a href="#%28xrepl._describe%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,describe</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<phase-number>] <identifier-or-module> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">describe a (bound) identifier</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,desc</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,id</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>For each of the specified names, describe where where it is coming
from and how it was defined if it names a known binding. In addition,
describe the module (list its imports and exports) that is named by
arguments that are known module names.</p><p>By default, bindings are searched for at the runtime level (phase 0).
You can add a different phase level for identifier lookups as a first
argument. In this case, only a binding can be described, even if the
same name is a known module.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._doc)"></a><a href="#%28xrepl._doc%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,doc</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><any> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">browse the racket documentation</span></p></td></tr></table></p><p>Uses Racket’s <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Interactive_Help.html%23%2528form._%2528%2528lib._racket%252Fhelp..rkt%2529._help%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">help</a></span> to browse the documentation, look for a
binding, etc. Note that this can be used even in languages that don’t
have the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Interactive_Help.html%23%2528form._%2528%2528lib._racket%252Fhelp..rkt%2529._help%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">help</a></span> binding.</p><h4 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Requiring_and_Loading_Files"">2.3<tt> </tt><a name="(part._.Requiring_and_.Loading_.Files)"></a>Requiring and Loading Files</h4><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._require)"></a><a href="#%28xrepl._require%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><require-spec> ...+</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">require a module</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,req</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,r</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Most arguments are passed to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span> as is. As a
convenience, if a symbolic argument specifies an existing file name,
then use its string form to specify the require, or use a
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._file%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">file</a></span> in case of an absolute path. In addition, an argument
that names a known symbolic module name (e.g., one that was defined on
the REPL, or a builtin module like <span class="RktSym">#%network</span>), then its
quoted form is used. (Note that these shorthands do not work inside
require subforms like <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._only-in%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">only-in</a></span>.)</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._require-reloadable)"></a><a href="#%28xrepl._require-reloadable%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require-reloadable</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><module> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">require a module, make it reloadable</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,reqr</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,rr</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Same as <a href="#%28xrepl._require%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require</span><span class="hspace"></span></span></a>, but arranges to load the code in a way that
makes it possible to reload it later, or if a module was already
loaded (using this command) then reload it. Note that the arguments
should be simple module names, without any require macros. If no
arguments are given, use arguments from the last use of this command
(if any).</p><p>Module reloading is enabled by turning off the
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._compile-enforce-module-constants%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">compile-enforce-module-constants</a></span> parameter —<wbr></wbr> note that this
prohibits some optimizations, since the compiler assumes that all
bindings may change.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._enter)"></a><a href="#%28xrepl._enter%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,enter</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<module>] [noisy?]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">require a module and go into its namespace</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,en</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=interactive.html%23%2528form._%2528%2528lib._racket%252Fenter..rkt%2529._enter%2521%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">enter!</a></span> to have the REPL go “inside” a given module’s
namespace. A module name can specify an existing file as with the
<a href="#%28xrepl._require-reloadable%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,require-reloadable</span><span class="hspace"></span></span></a> command. If no module is given, and the REPL
is already in some module’s namespace, then ‘enter!’ is used with that
module, causing it to reload if needed. Using <span class="RktVal">#f</span> makes it go
back to the toplevel namespace.</p><p>Note that this can be used even in languages that don’t have the
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=interactive.html%23%2528form._%2528%2528lib._racket%252Fenter..rkt%2529._enter%2521%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">enter!</a></span> binding. In addition, <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=interactive.html%23%2528form._%2528%2528lib._racket%252Fenter..rkt%2529._enter%2521%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">enter!</a></span> is used in a
way that does not make it require itself into the target namespace.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._toplevel)"></a><a href="#%28xrepl._toplevel%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,toplevel</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">go back to the toplevel</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,top</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Makes the REPL go back to the toplevel namespace. Same as using the
<a href="#%28xrepl._enter%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,enter</span><span class="hspace"></span></span></a> command with a <span class="RktVal">#f</span> argument.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._load)"></a><a href="#%28xrepl._load%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,load</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><filename> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">load a file</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,ld</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._load%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">load</a></span> to load the specified file(s).</p><h4 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Debugging"">2.4<tt> </tt><a name="(part._.Debugging)"></a>Debugging</h4><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._backtrace)"></a><a href="#%28xrepl._backtrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,backtrace</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">see a backtrace of the last exception</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,bt</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Whenever an error is displayed, XREPL will not show its context
printout. Instead, use the <a href="#%28xrepl._backtrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,backtrace</span><span class="hspace"></span></span></a> command to display the
backtrace for the last error.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._time)"></a><a href="#%28xrepl._time%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,time</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<count>] <expr> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">time an expression</span></p></td></tr></table></p><p>Times execution of an expression (or expressions). This is similar to
<span class="RktVal">"time"</span> but the information that is displayed is a bit easier to
read.</p><p>In addition, you can provide an initial number to specify repeating
the evaluation a number of times. In this case, each iteration is
preceded by two garbage collections, and when the iteration is done
its timing information and evaluation result(s) are displayed. When
the requested number of repetitions is done, some extreme results are
removed (top and bottom 2/7ths), and the remaining results are be
averaged. Finally, the resulting value(s) are from the last run are
returned (and can be accessed via the bindings for the last few
results, see <a href="#%28part._past-vals%29" data-pltdoc="x">Past Evaluation Results</a>).</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._trace)"></a><a href="#%28xrepl._trace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,trace</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><function> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">trace a function</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,tr</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Traces the named function (or functions), using <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=debugging.html%23%2528form._%2528%2528lib._racket%252Ftrace..rkt%2529._trace%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">trace</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._untrace)"></a><a href="#%28xrepl._untrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,untrace</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><function> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">untrace a function</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,untr</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Untraces the named function (or functions), using <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=debugging.html%23%2528form._%2528%2528lib._racket%252Ftrace..rkt%2529._untrace%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">untrace</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._errortrace)"></a><a href="#%28xrepl._errortrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errortrace</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<flag>]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">errortrace instrumentation control</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errt</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,inst</span><span class="hspace"></span></span>]</p></td></tr></table></p><p><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> is a useful Racket library which can
provide a number of useful services like precise profiling, test
coverage, and accurate error information. However, using it can be a
little tricky. <a href="#%28xrepl._errortrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errortrace</span><span class="hspace"></span></span></a> and a few related commands fill this
gap, making <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> easier to use.</p><p><a href="#%28xrepl._errortrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errortrace</span><span class="hspace"></span></span></a> controls global use of <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a>.
With a flag argument of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span> errortrace instrumentation is
turned on, with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> it is turned off, and with no arguments it
is toggled. In addition, a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span> flag displays instrumentation
state.</p><p>Remember that <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> instrumentation hooks into
the Racket compiler, and applies only to source code that gets loaded
from source and therefore compiled. Therefore, you should use it
<span style="font-style: italic">before</span> loading the code that you want to instrument.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._profile)"></a><a href="#%28xrepl._profile%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,profile</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<expr> | <flag> ...]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">profiler control</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,prof</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>This command can perform profiling of code in one of two very
different ways: either statistical profiling via the
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=profile&rel=index.html%23%2528mod-path._profile%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">profile</span></a> library, or using the exact profiler feature
of <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a>.</p><p>When given a parenthesized expression, <a href="#%28xrepl._profile%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,profile</span><span class="hspace"></span></span></a> will run it via
the statistical profiler, as with the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=profile&rel=index.html%23%2528form._%2528%2528lib._profile%252Fmain..rkt%2529._profile%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">profile</a></span> form, reporting
results as usual. This profiler adds almost no overhead, and it
requires no special setup. In particular, it does not require
pre-compiling code in a special way. However, there are some
imprecise elements to this profiling: the profiler samples stack
snapshots periodically which can miss certain calls, and it is also
sensitive to some compiler optimizations like inlining procedures and
thereby not showing them in the displayed analysis. See
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=profile&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Profile: Statistical Profiler</a> for more
information.</p><p>In the second mode of operation, <a href="#%28xrepl._profile%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,profile</span><span class="hspace"></span></span></a> uses the precise
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> profiler. This profiler produces precise
results, but like other uses of the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a>, it
must be enabled before loading the code that is to be profiled. It
can add noticeable overhead (potentially affecting the reported
runtimes), but the results are accurate in the sense that no procedure
is skipped. (For additional details, see
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Errortrace: Debugging and Profiling</a>.)</p><p>In this mode, the arguments are flags that control the profiler. A
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span> flag turns the profiler on —<wbr></wbr> and as usual with
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> functionality, this applies to code that is
compiled from now on. A <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> flag turns this instrumentation
off, and without any flags it is toggled. Once the profiler is
enabled, you can run some code and then use this command to report
profiling results: use <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> to show profiling results by time,
and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#</span><span class="hspace"></span></span> for the results by counts. Once you’ve seen the
results, you can evaluate additional code to collect more profiling
information, or you can reset the results with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">!</span><span class="hspace"></span></span> flag.
You can also combine several flags to perform the associated
operations, for example, <a href="#%28xrepl._profile%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,prof *!-</span><span class="hspace"></span></span></a> will show the accumulated
results, clear them, and turn profiler instrumentation off.</p><p>Note that using <span style="font-style: italic">any</span> of these flags turns errortrace
instrumentation on, even <a href="#%28xrepl._profile%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,prof -</span><span class="hspace"></span></span></a> (or no flags). Use the
<a href="#%28xrepl._errortrace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,errortrace</span><span class="hspace"></span></span></a> command to turn off instrumentation completely.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._execution-counts)"></a><a href="#%28xrepl._execution-counts%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,execution-counts</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><file> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">execution counts</span></p></td></tr></table></p><p>This command makes it easy to use the execution counts functionality
of <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a>. Given a file name (or names),
<a href="#%28xrepl._execution-counts%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,execution-counts</span><span class="hspace"></span></span></a> will enable errortrace instrumentation for
coverage, require the file(s), display the results, disables coverage,
and disables instrumentation (if it wasn’t previously turned on).
This is useful as an indication of how well the test coverage is for
some file.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._coverage)"></a><a href="#%28xrepl._coverage%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,coverage</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><file></span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">coverage information via a sandbox</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,cover</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Runs a given file and displays coverage information for the run. This
is somewhat similar to the <a href="#%28xrepl._execution-counts%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,execution-counts</span><span class="hspace"></span></span></a> command, but instead
of using <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=errortrace&rel=using-errortrace.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">errortrace</span></a> directly, it runs the file in a
(trusted) sandbox, using the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Sandboxed_Evaluation.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/sandbox</span></a> library
and its ability to provide coverage information.</p><h4 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Miscellaneous_Commands"">2.5<tt> </tt><a name="(part._.Miscellaneous_.Commands)"></a>Miscellaneous Commands</h4><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._switch-namespace)"></a><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch-namespace</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<name>] [? | - | ! [<init>]]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">switch to a different repl namespace</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>This powerful command controls the REPL’s namespace. While
<a href="#%28xrepl._enter%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,enter</span><span class="hspace"></span></span></a> can be used to make the REPL go into the namespace of a
specific module, the <a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch-namespace</span><span class="hspace"></span></span></a> command can switch between
<span style="font-style: italic">toplevel namespaces</span>, allowing you to get multiple separate
“workspaces”.</p><p>Namespaces are given names that are symbols or integers, where
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> is the name for the first initial namespace, serving as
the default one. These names are not bindings —<wbr></wbr> they are only used
to label the known namespaces.</p><p>The most basic usage for this command is to simply specify a new name.
A namespace that corresponds to that name will be created and the REPL
will switch to that namespace. The prompt will now indicate this
namespace’s name. The name is usually insignificant, except when it
is a <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span>-able module: in this case, the new namespace is
initialized to use that module’s bindings. For example,
<a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch racket/base</span><span class="hspace"></span></span></a> creates a new namespace that is called
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">racket/base</span><span class="hspace"></span></span> and initializes it with
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/base</span></a>. For all other names, the new namespace
is initialized the same as the current one.</p><p><div class="SIntrapara">Additional <a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch</span><span class="hspace"></span></span></a> uses:
</div><div class="SIntrapara"><ul><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch !</span><span class="hspace"></span></span></a> —<wbr></wbr> reset the current namespace, recreating it
using the same initial library. Note that it is forbidden to reset
the default initial namespace, the one named <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> —<wbr></wbr> this
namespace corresponds to the one that Racket was started with, and
where XREPL was initialized. There is no technical reason for
forbidding this, but doing so is not useful as no resources will
actually be freed.</p></li><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch ! <module></span><span class="hspace"></span></span></a> —<wbr></wbr> resets the current namespace with
the explicitly given simple module spec.</p></li><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch <name> !</span><span class="hspace"></span></span></a> —<wbr></wbr> switch to a newly made namespace. If
a namespace by that name already existed, it is rest.</p></li><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch <name> ! <module></span><span class="hspace"></span></span></a> —<wbr></wbr> same, but reset to the given
module instead of what it previously used.</p></li><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch - <name></span><span class="hspace"></span></span></a> —<wbr></wbr> drop the specified namespace, making
it possible to garbage-collect away any associated resources. You
cannot drop the current namespace or the default one (<span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span>).</p></li><li><p><a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch ?</span><span class="hspace"></span></span></a> —<wbr></wbr> list all known namespaces.</p></li></ul></div></p><p>Do not confuse namespaces with sandboxes or custodians. The
<a href="#%28xrepl._switch-namespace%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,switch</span><span class="hspace"></span></span></a> command changes <span style="font-style: italic">only</span> the
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Namespaces.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-namespace%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">current-namespace</a></span> —<wbr></wbr> it does not install a new custodian or
restricts evaluation in any way. Note that it is possible to pass
around values from one namespace to another via past result reference;
see <a href="#%28part._past-vals%29" data-pltdoc="x">Past Evaluation Results</a>.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._syntax)"></a><a href="#%28xrepl._syntax%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,syntax</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<expr>] [<flag> ...]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">set syntax object to inspect, and control it</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,stx</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,st</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Manipulate syntaxes and inspect their expansion.</p><p>Useful operations revolve around a “currently set syntax”. With no
arguments, the currently set syntax is displayed; an argument of
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> sets the current syntax from the last input to the REPL;
and an argument that holds any other s-expression will set it as the
current syntax.</p><p><div class="SIntrapara">Syntax operations are specified via flags:
</div><div class="SIntrapara"><ul><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span> uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Expanding_Top-Level_Forms.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._expand-once%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">expand-once</a></span> on the current syntax and
prints the resulting syntax. In addition, the result becomes the
new “current” syntax, so you can use this as a poor-man’s syntax
stepper. (Note that in some rare cases expansion via a sequence of
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Expanding_Top-Level_Forms.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._expand-once%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">expand-once</a></span> might differ from the actual expansion.)</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">!</span><span class="hspace"></span></span> uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Expanding_Top-Level_Forms.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._expand%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">expand</a></span> to completely expand the
current syntax.</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> uses the macro debugger’s textual output to show
expansion steps for the current syntax, leaving macros from
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/base</span></a> intact. Does not change the current
syntax. Uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=macro-debugger&rel=index.html%23%2528def._%2528%2528lib._macro-debugger%252Fstepper-text..rkt%2529._expand%252Fstep-text%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">expand/step-text</a></span>, see <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=macro-debugger&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Macro Debugger: Inspecting Macro Expansion</a> for details.</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">**</span><span class="hspace"></span></span> uses the macro debugger similarly to <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span>,
but expands <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/base</span></a> macros too, showing the
resulting full expansion process.</p></li></ul></div><div class="SIntrapara">Several input flags and/or syntaxes can be specified in succession as
arguments to <a href="#%28xrepl._syntax%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,syntax</span><span class="hspace"></span></span></a>. For example, <a href="#%28xrepl._syntax%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,stx (when 1 2) ** !</span><span class="hspace"></span></span></a>.</div></p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._check-requires)"></a><a href="#%28xrepl._check-requires%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,check-requires</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn">[<module>]</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">check the `require's of a module</span></p></td></tr><tr><td><p><span class="hspace"> </span>[Synonyms: <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,ckreq</span><span class="hspace"></span></span>]</p></td></tr></table></p><p>Uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=macro-debugger&rel=index.html%23%2528def._%2528%2528lib._macro-debugger%252Fanalysis%252Fcheck-requires..rkt%2529._show-requires%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">show-requires</a></span> to analyze the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span>s of the
specified module, defaulting to the currently entered module if we’re
in one. See <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=macro-debugger&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Macro Debugger: Inspecting Macro Expansion</a>
for details.</p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._log)"></a><a href="#%28xrepl._log%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,log</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span><span class="RktIn"><opt> ...</span><span class="hspace"></span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">control log output</span></p></td></tr></table></p><p><div class="SIntrapara">Starts (or stops) logging events at a specific level. The level can
be:
</div><div class="SIntrapara"><ul><li><p>a known level name (currently one of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">fatal</span><span class="hspace"></span></span>,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">error</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">warning</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">info</span><span class="hspace"></span></span>,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">debug</span><span class="hspace"></span></span>),</p></li><li><p><span class="RktVal">#f</span> for no logging,</p></li><li><p><span class="RktVal">#t</span> for maximum logging,</p></li><li><p>an integer level specification, with <span class="RktVal">0</span> for no logging
and bigger ones for additional verbosity.</p></li></ul></div></p><p><table cellspacing="0" cellpadding="0" class="boxed"><tr><td><p><a name="(xrepl._install!)"></a><a href="#%28xrepl._install%21%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,install!</span><span class="hspace"></span></span></a><span class="RktInBG"><span class="hspace"> </span></span></p></td></tr><tr><td><p><span class="hspace"> </span><span style="font-style: italic">install xrepl in your Racket init file</span></p></td></tr></table></p><p>Convenient utility command to install XREPL in your Racket
initialization file. This is done carefully, you will be notified of
potential issues, and asked to authorize changes.</p><h3 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""past-vals"">3<tt> </tt><a name="(part._past-vals)"></a>Past Evaluation Results</h3><p>XREPL makes the last few interaction results available for evaluation
via special toplevel variables: <span class="RktSym">^</span>, <span class="RktSym">^^</span>,
..., <span class="RktSym">^^^^^</span>. The first, <span class="RktSym">^</span>, refers to the
last result, <span class="RktSym">^^</span> to the previous one and so on.</p><p><div class="SIntrapara">As with the usual REPL printouts, <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=void_undefined.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="nobreak"><span class="RktRes">#<void></span></span></a> results are not kept. In
case of multiple results, they are spliced in reverse, so
<span class="RktSym">^</span> refers to the last result of the last evaluation. For
example:
</div><div class="SIntrapara"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">-> 1</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">1</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> (values 2 3)</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">2</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">3</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> (values 4)</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">4</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> (list ^ ^^ ^^^ ^^^^)</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">'(4 3 2 1)</span></p></td></tr></table></div><div class="SIntrapara">The rationale for this is that <span class="RktSym">^</span> always refers to the
last <span style="font-style: italic">printed</span> result, <span class="RktSym">^^</span> to the one before that,
etc.</div></p><p>In addition to these names, XREPL also binds <span class="RktSym">$1</span>,
<span class="RktSym">$2</span>, ..., <span class="RktSym">$5</span> to the same references, so you
can choose the style that you like. All of these bindings are made
available only if they are not already defined. This means that if you
have code that uses these names, it will continue to work as usual (and
it will shadow the saved value binding).</p><p>The bindings are identifier macros that expand to the literal saved
values; so referring to a saved value that is missing (because not
enough values were shown) raises a syntax error. In addition, the
values are held in a <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=eval-model.html%23%2528tech._weak._reference%2529&version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">weak reference</span></a>, so they can disappear after
a garbage-collection.</p><p>Note that this facility can be used to “transfer” values from one
namespace to another—<wbr></wbr>but beware of struct values that might come from
a different instantiation of a module.</p><h3 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""Hacking_XREPL"">4<tt> </tt><a name="(part._.Hacking_.X.R.E.P.L)"></a>Hacking XREPL</h3><p>XREPL is mainly a convenience tool, and as such you might want to hack
it to better suit your needs. Currently, there is no convenient way to
customize and extend it, but this will be added in the future.</p><p><div class="SIntrapara">Meanwhile, if you’re interested in tweaking XREPL, the <a href="#%28xrepl._enter%29" class="plainlink" data-pltdoc="x"><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,enter</span><span class="hspace"></span></span></a>
command can be used as usual to go into its implementation. For
example —<wbr></wbr> change an XREPL parameter:
</div><div class="SIntrapara"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">-> ,en xrepl/xrepl</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">xrepl/xrepl> ,e</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">xrepl/xrepl> (saved-values-char #\~)</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">xrepl/xrepl> ,top</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> 123</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">123</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> ~</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">123</span></p></td></tr></table></div><div class="SIntrapara">or add a command:
</div><div class="SIntrapara"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">-> ,en xrepl/xrepl</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">xrepl/xrepl> (defcommand eli "stuff" "eli says" ["Make eli say stuff"]</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">(printf "Eli says: ~a\n" (getarg 'line)))</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">xrepl/xrepl> ,top</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">-> ,eli moo</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">Eli says: moo</span></p></td></tr></table></div><div class="SIntrapara">While this is not intended as <span style="font-style: italic">the</span> way to extend and customize
XREPL, it is a useful debugging tool should you want to do so.</div></p><p>If you have any useful tweaks and extensions, please mail the author or
the Racket developer’s
<a href="http://racket-lang.org/community.html">mailing list</a>.</p><h3 x-source-module="(lib "xrepl/xrepl.scrbl")" x-part-tag=""License_Issues"">5<tt> </tt><a name="(part._.License_.Issues)"></a>License Issues</h3><p>Under most circumstances XREPL uses the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=readline&rel=index.html%23%2528mod-path._readline%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">readline</span></a>
library, and therefore a similar license caveat applies: XREPL cannot be
enabled by default because of the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=readline&rel=index.html%23%2528part._readline-license%2529&version=6.1" class="Sq" data-pltdoc="x">readline licensing</a>, you have to explicitly do so yourself to use
it. (Note that XREPL is intended to be used only for enhanced
interaction, not as a library; so there are no additional issues.)</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <span class="nonavigation">← prev</span> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">up</a> <span class="nonavigation">next →</span></span> </div></div></div><div id="contextindicator"> </div></body></html>
|