/usr/share/doc/racket/ts-guide/quick.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 | <!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 Quick Start</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">The Typed Racket Guide</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Quick Start</a></td></tr><tr><td align="right">2 </td><td><a href="beginning.html" class="tocviewlink" data-pltdoc="x">Beginning Typed Racket</a></td></tr><tr><td align="right">3 </td><td><a href="more.html" class="tocviewlink" data-pltdoc="x">Specifying Types</a></td></tr><tr><td align="right">4 </td><td><a href="types.html" class="tocviewlink" data-pltdoc="x">Types in Typed Racket</a></td></tr><tr><td align="right">5 </td><td><a href="occurrence-typing.html" class="tocviewlink" data-pltdoc="x">Occurrence Typing</a></td></tr><tr><td align="right">6 </td><td><a href="typed-untyped-interaction.html" class="tocviewlink" data-pltdoc="x">Typed-<wbr></wbr>Untyped Interaction</a></td></tr><tr><td align="right">7 </td><td><a href="optimization.html" class="tocviewlink" data-pltdoc="x">Optimization in Typed Racket</a></td></tr><tr><td align="right">8 </td><td><a href="caveats.html" class="tocviewlink" data-pltdoc="x">Caveats and Limitations</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="" class="tocviewselflink" data-pltdoc="x">Quick Start</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.1 </td><td><a href="#%28part._.Using_.Typed_.Racket_from_the_.Racket_.R.E.P.L%29" class="tocviewlink" data-pltdoc="x">Using Typed Racket from the Racket REPL</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.1<tt> </tt></span><a href="#%28part._.Using_.Typed_.Racket_from_the_.Racket_.R.E.P.L%29" class="tocsubseclink" data-pltdoc="x">Using Typed Racket from the Racket REPL</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.7</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.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="index.html" title="backward to "The Typed Racket Guide"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "The Typed Racket Guide"" data-pltdoc="x">up</a> <a href="beginning.html" title="forward to "2 Beginning Typed Racket"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "typed-racket/scribblings/ts-guide.scrbl")" x-source-pkg="typed-racket-doc" x-part-tag=""quick"">1<tt> </tt><a name="(part._quick)"></a>Quick Start</h3><p>Given a module written in the <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a> language, using
Typed Racket requires the following steps:</p><ol><li><p>Change the language to <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">typed/racket</span></a>.</p></li><li><p>Change the uses of <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktSym">mod</span><span class="RktPn">)</span> to
<span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktSym">typed/mod</span><span class="RktPn">)</span>.</p></li><li><p>Annotate structure definitions and top-level
definitions with their types.</p></li></ol><p>Then, when the program is run, it will automatically be typechecked
before any execution, and any type errors will be reported. If there
are any type errors, the program will not run.</p><p>Here is an example program, written in the <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a>
language:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.7" 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="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">; </span><span class="RktSym">distance</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._%7E3a%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">:</a></span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym">real</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">distance</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._sqrt%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqrt</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528lib._racket%252Fmath..rkt%2529._sqr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqr</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-x</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-x</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528lib._racket%252Fmath..rkt%2529._sqr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqr</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-y</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-y</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Here is the same program, in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">typed/racket</span></a>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">typed/racket</span></a></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._%7E3a%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">:</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._%7E3a%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">:</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._%7E3a%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">:</a></span><span class="hspace"> </span><span class="RktSym">distance</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types-extra..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktSym">pt</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=type-ref.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fbase-types..rkt%2529._.Real%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">Real</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=ts-reference&rel=special-forms.html%23%2528form._%2528%2528lib._typed-racket%252Fbase-env%252Fprims..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">distance</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._sqrt%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqrt</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528lib._racket%252Fmath..rkt%2529._sqr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqr</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-x</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-x</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528lib._racket%252Fmath..rkt%2529._sqr%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">sqr</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._-%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-y</span><span class="hspace"> </span><span class="RktSym">p2</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">pt-y</span><span class="hspace"> </span><span class="RktSym">p1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><h4 x-source-module="(lib "typed-racket/scribblings/ts-guide.scrbl")" x-source-pkg="typed-racket-doc" x-part-tag=""Using_Typed_Racket_from_the_Racket_REPL"">1.1<tt> </tt><a name="(part._.Using_.Typed_.Racket_from_the_.Racket_.R.E.P.L)"></a>Using Typed Racket from the Racket REPL</h4><p><div class="SIntrapara">It is possible to use Typed Racket from the Racket REPL. To do so, start Racket
with the following command line:
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">racket -I typed/racket</span></div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="index.html" title="backward to "The Typed Racket Guide"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "The Typed Racket Guide"" data-pltdoc="x">up</a> <a href="beginning.html" title="forward to "2 Beginning Typed Racket"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|