/usr/share/doc/racket/drracket/interactions-window.html is in racket-doc 6.3-1.
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 | <!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>1.6 The Interactions Window</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="../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="../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">Dr<span class="mywbr"> </span>Racket:<span class="mywbr"> </span> The Racket Programming Environment</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="interface-essentials.html" class="tocviewselflink" data-pltdoc="x">Interface Essentials</a></td></tr><tr><td align="right">2 </td><td><a href="languages.html" class="tocviewlink" data-pltdoc="x">Languages</a></td></tr><tr><td align="right">3 </td><td><a href="Interface_Reference.html" class="tocviewlink" data-pltdoc="x">Interface Reference</a></td></tr><tr><td align="right">4 </td><td><a href="extending-drracket.html" class="tocviewlink" data-pltdoc="x">Extending Dr<span class="mywbr"> </span>Racket</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>1 </td><td><a href="interface-essentials.html" class="tocviewlink" data-pltdoc="x">Interface Essentials</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.1 </td><td><a href="buttons.html" class="tocviewlink" data-pltdoc="x">Buttons</a></td></tr><tr><td align="right">1.2 </td><td><a href="choose-language.html" class="tocviewlink" data-pltdoc="x">Choosing a Language</a></td></tr><tr><td align="right">1.3 </td><td><a href="editor.html" class="tocviewlink" data-pltdoc="x">Editing with Parentheses</a></td></tr><tr><td align="right">1.4 </td><td><a href="Searching.html" class="tocviewlink" data-pltdoc="x">Searching</a></td></tr><tr><td align="right">1.5 </td><td><a href="Tabbed_Editing.html" class="tocviewlink" data-pltdoc="x">Tabbed Editing</a></td></tr><tr><td align="right">1.6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">The Interactions Window</a></td></tr><tr><td align="right">1.7 </td><td><a href="Graphical_Syntax.html" class="tocviewlink" data-pltdoc="x">Graphical Syntax</a></td></tr><tr><td align="right">1.8 </td><td><a href="debugger.html" class="tocviewlink" data-pltdoc="x">Graphical Debugging Interface</a></td></tr><tr><td align="right">1.9 </td><td><a href="module-browser.html" class="tocviewlink" data-pltdoc="x">The Module Browser</a></td></tr><tr><td align="right">1.10 </td><td><a href="color-scheme.html" class="tocviewlink" data-pltdoc="x">Color Schemes</a></td></tr><tr><td align="right">1.11 </td><td><a href="create-exe.html" class="tocviewlink" data-pltdoc="x">Creating Executables</a></td></tr><tr><td align="right">1.12 </td><td><a href="follow-log.html" class="tocviewlink" data-pltdoc="x">Following Log Messages</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>1.6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">The Interactions Window</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.6.1 </td><td><a href="#%28part._.Errors%29" class="tocviewlink" data-pltdoc="x">Errors</a></td></tr><tr><td align="right">1.6.2 </td><td><a href="#%28part._.Input_and_.Output%29" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">1.6.1<tt> </tt></span><a href="#%28part._.Errors%29" class="tocsubseclink" data-pltdoc="x">Errors</a></td></tr><tr><td><span class="tocsublinknumber">1.6.2<tt> </tt></span><a href="#%28part._.Input_and_.Output%29" class="tocsubseclink" data-pltdoc="x">Input and Output</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.3", "../");" 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.3");">top</a></span><span class="navright"> <a href="Tabbed_Editing.html" title="backward to "1.5 Tabbed Editing"" data-pltdoc="x">← prev</a> <a href="interface-essentials.html" title="up to "1 Interface Essentials"" data-pltdoc="x">up</a> <a href="Graphical_Syntax.html" title="forward to "1.7 Graphical Syntax"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/drracket/drracket.scrbl")" x-source-pkg="drracket" x-part-tag=""interactions-window"">1.6<tt> </tt><a name="(part._interactions-window)"></a>The Interactions Window</h4><p><a name="(idx._(gentag._23._(lib._scribblings/drracket/drracket..scrbl)))"></a><a name="(idx._(gentag._24._(lib._scribblings/drracket/drracket..scrbl)))"></a>The
interactions window lets you type an expression after the <span class="stt">></span>
prompt for immediate evaluation. You cannot modify any text before the
last <span class="stt">></span> prompt. To enter an expression, the blinking caret must
appear after the last prompt, and also after the space following the
prompt.</p><p>When you type a complete expression and hit Enter or Return, DrRacket
evaluates the expression and prints the result. After printing the
result, DrRacket creates a new prompt for another expression. Some
expressions return a special “void” value; DrRacket never prints
void, but instead produces a new prompt immediately.</p><p>If the expression following the current prompt is incomplete, then
DrRacket will not try to evaluate it. In that case, hitting Enter or
Return produces a new, auto-indented line. You can force DrRacket to
evaluate the expression by typing Alt-Return or Command-Return
(depending on your platform).</p><p>To copy the <a name="(idx._(gentag._25._(lib._scribblings/drracket/drracket..scrbl)))"></a>previous expression to the current prompt, type
ESC-p (i.e., type Escape and then type p). Type ESC-p multiple times
to <a name="(idx._(gentag._26._(lib._scribblings/drracket/drracket..scrbl)))"></a>cycle back through old expressions. Type ESC-n to cycle
forward through old expressions. There are other keys that have these
same functions; see <a href="Keyboard_Shortcuts.html" data-pltdoc="x">Keyboard Shortcuts</a> and the menu
item <span class="ssansserif">Show Active Keybindings</span> menu item in the <span class="ssansserif">Edit</span> menu.</p><p>Clicking the <span class="ssansserif">Run</span> button evaluates the program in the
<a href="interface-essentials.html#%28tech._definitions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">definitions window</span></a> and makes the program’s definitions
available in the interactions window. Clicking <span class="ssansserif">Run</span> also
resets the interactions window, erasing all old interactions and
removing old definitions from the interaction environment. Although
<span class="ssansserif">Run</span> erases old <span class="stt">></span> prompts, ESC-p and ESC-n can still
retrieve old expressions.</p><h5 x-source-module="(lib "scribblings/drracket/drracket.scrbl")" x-source-pkg="drracket" x-part-tag=""Errors"">1.6.1<tt> </tt><a name="(part._.Errors)"></a>Errors</h5><p><a name="(idx._(gentag._27._(lib._scribblings/drracket/drracket..scrbl)))"></a>Whenever DrRacket encounters an error
while evaluating an expression, it prints an error message in the
interactions window and highlights the expression that triggered the
error. The highlighted expression might be in the definitions window,
or it might be after an old prompt in the interactions window.</p><p>For certain kinds of errors, DrRacket turns a portion of the error
message into a hyperlink. Click the hyperlink to get help regarding a
function or keyword related to the error.</p><p>For some run-time errors, DrRacket shows a bug icon next to the error
message. Click the bug icon to open a window that shows a “stack” of
expressions that were being evaluated at the time of the error. In
addition, if the expressions in the stack appear in the
<a href="interface-essentials.html#%28tech._definitions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">definitions window</span></a>, a red arrow is drawn to each expression
from the next deeper one in the stack.</p><h5 x-source-module="(lib "scribblings/drracket/drracket.scrbl")" x-source-pkg="drracket" x-part-tag=""Input_and_Output"">1.6.2<tt> </tt><a name="(part._.Input_and_.Output)"></a><a name="(idx._(gentag._28._(lib._scribblings/drracket/drracket..scrbl)))"></a>Input and Output</h5><p>Many Racket programs avoid explicit input and output operations,
obtaining input via direct function calls in the <a href="interface-essentials.html#%28tech._interactions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">interactions
window</span></a>, and producing output by returning values. Other Racket
programs explicitly print output for the user during evaluation using
<a name="(idx._(gentag._29._(lib._scribblings/drracket/drracket..scrbl)))"></a><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._write%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">write</a></span> or <a name="(idx._(gentag._30._(lib._scribblings/drracket/drracket..scrbl)))"></a><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._display%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">display</a></span>, or
explicitly request input from the user using <a name="(idx._(gentag._31._(lib._scribblings/drracket/drracket..scrbl)))"></a><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span>
or <a name="(idx._(gentag._32._(lib._scribblings/drracket/drracket..scrbl)))"></a><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Byte_and_String_Input.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-char%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read-char</a></span>.</p><p>Explicit input and output appear in the <a href="interface-essentials.html#%28tech._interactions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">interactions window</span></a>,
but within special boxes that separate explicit I/O from normal
expressions and results. For example, evaluating</p><blockquote class="SCodeFlow"><p><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span></p></blockquote><p>in the interactions window produces a special box for entering input:</p><blockquote class="SCentered"><p><img src="io.png" alt="" width="370" height="261"/></p></blockquote><p>Type a number into the box and hit Enter, and that number becomes the
result of the <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span> expression. Once text is submitted for
an input box, it is moved outside the input box, and when DrRacket
shows a new prompt, it hides the interaction box. Thus, if you type
<span class="RktVal">5</span> in the above input box and hit Return, the result appears
as follows:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">5</span></td></tr><tr><td><span class="RktRes">5</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="stt">_</span></td></tr></table></blockquote><p>In this case, the first <span class="stt">5</span> is the input, and the second
<span class="RktRes">5</span> is the result of the <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span> expression. The
second <span class="RktRes">5</span> is colored blue, as usual for a result printed
by DrRacket. (The underscore indicates the location of the blinking
caret.)</p><p>Output goes into the <a href="interface-essentials.html#%28tech._interactions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">interactions window</span></a> directly. If you run
the program</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.3" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">v</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._display%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">display</a></span><span class="hspace"> </span><span class="RktSym">v</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Byte_and_String_Output.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._newline%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">newline</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktSym">v</span></td></tr></table></blockquote><p>and provide the input S-expression <span class="RktPn">(</span><span class="RktVal">1</span><span class="stt"> </span><span class="RktVal">2</span><span class="RktPn">)</span>, the interactions
window ultimately appears as follows:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">(1 2)</span></td></tr><tr><td><span class="RktOut">(1 2)</span></td></tr><tr><td><span class="RktRes">'(1<span class="stt"> </span>2)</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="stt">_</span></td></tr></table></blockquote><p>In this example, <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._display%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">display</a></span> produces output immediately beneath
the input you typed, and the final result is printed last. The
displayed output is drawn in purple. (The above example assumes
default printing. With constructor-style value printing, the final
before the prompt would be <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">1</span><span class="stt"> </span><span class="RktVal">2</span><span class="RktPn">)</span>.)</p><p>Entering the same program line-by-line in the interactions window
produces a different-looking result:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.3" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">v</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">(1 2)</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._display%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">display</a></span><span class="hspace"> </span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktOut">(1 2)</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktSym">v</span></td></tr><tr><td><span class="RktRes">'(1<span class="stt"> </span>2)</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="stt">_</span></td></tr></table></blockquote><p>Depending on the input operation, you may enter more text into an
input box than is consumed. In that case, the leftover text remains in
the input stream for later reads. For example, in the following
interaction, two values are provided in response to the first
<span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span>, so the second value is returned immediately for the
second <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">5 6</span></td></tr><tr><td><span class="RktRes">5</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktRes">6</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="stt">_</span></td></tr></table></blockquote><p>The following example illustrates that submitting input with Return
inserts a newline character into the input stream:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">5</span></td></tr><tr><td><span class="RktRes">5</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Byte_and_String_Input.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-char%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read-char</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktRes">#\newline</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="stt">_</span></td></tr></table></blockquote><p>The <span class="ssansserif">eof</span> button that appears beside an input box inserts
a single <span class="RktSym">eof-object</span> into the input stream, but more IO may
follow in a later sequence. For example, in the following interaction,
the user typed <span class="RktInBG"><span class="hspace"></span><span class="RktIn">1</span><span class="hspace"></span></span> and then clicked the <span class="ssansserif">eof</span> button:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Byte_and_String_Input.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-char%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read-char</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">1</span><span class="RktRes">#\1</span></td></tr><tr><td><span class="stt">></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=Byte_and_String_Input.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-char%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">read-char</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktRes">#<eof></span></td></tr></table></blockquote><p>At this point, however, future interactions can still take place:
new calls to input functions with open a new input box and new
characters will come from the same port.</p><p>Within a <a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a> module,
the results of top-level expression print the same as the results of
an expression entered in the <a href="interface-essentials.html#%28tech._interactions._window%29" class="techoutside" data-pltdoc="x"><span class="techinside">interactions window</span></a>. The reason is
that <a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.3" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a> explicitly
prints the results of top-level expressions using
<span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-print%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">current-print</a></span><span class="RktPn">)</span>, and DrRacket sets <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.3/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-print%2529%2529&version=6.3" class="RktValLink Sq" data-pltdoc="x">current-print</a></span><span class="RktPn">)</span>
to print values in the same way as for interactions.</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.3", "../");" 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.3");">top</a></span><span class="navright"> <a href="Tabbed_Editing.html" title="backward to "1.5 Tabbed Editing"" data-pltdoc="x">← prev</a> <a href="interface-essentials.html" title="up to "1 Interface Essentials"" data-pltdoc="x">up</a> <a href="Graphical_Syntax.html" title="forward to "1.7 Graphical Syntax"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|