This file is indexed.

/usr/share/doc/racket/tools/adding-languages.html is in racket-doc 6.7-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!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>2&nbsp;Adding Languages to DrRacket</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,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Dr<span class="mywbr"> &nbsp;</span>Racket Plugins</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="implementing-tools.html" class="tocviewlink" data-pltdoc="x">Implementing Dr<span class="mywbr"> &nbsp;</span>Racket Plugins</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Adding Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="Creating_New_Kinds_of_DrRacket_Frames.html" class="tocviewlink" data-pltdoc="x">Creating New Kinds of Dr<span class="mywbr"> &nbsp;</span>Racket Frames</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="Extending_the_Existing_DrRacket_Classes.html" class="tocviewlink" data-pltdoc="x">Extending the Existing Dr<span class="mywbr"> &nbsp;</span>Racket Classes</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="Expanding_and_Breaking.html" class="tocviewlink" data-pltdoc="x">Expanding the User&rsquo;s Program Text and Breaking</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="Editor_Modes.html" class="tocviewlink" data-pltdoc="x">Editor Modes</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="Language-Specific_Capabilities.html" class="tocviewlink" data-pltdoc="x">Language-<wbr></wbr>Specific Capabilities</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="Check_Syntax.html" class="tocviewlink" data-pltdoc="x">Check Syntax</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Cooperating_with_Background_Check_Syntax.html" class="tocviewlink" data-pltdoc="x">Cooperating with Background Check Syntax</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="Teaching_Languages.html" class="tocviewlink" data-pltdoc="x">Teaching Languages</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="Signatures.html" class="tocviewlink" data-pltdoc="x">Signatures</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="drracket_get_extend.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>get/<span class="mywbr"> &nbsp;</span>extend</span></a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="drracket_unit.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>unit</span></a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="drracket_language.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>language</span></a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="drracket_language-configuration.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>language-<wbr></wbr>configuration</span></a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="drracket_debug.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>debug</span></a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="drracket_rep.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>rep</span></a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="drracket_frame.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>frame</span></a></td></tr><tr><td align="right">19&nbsp;</td><td><a href="drracket_help-desk.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>help-<wbr></wbr>desk</span></a></td></tr><tr><td align="right">20&nbsp;</td><td><a href="drracket_eval.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>eval</span></a></td></tr><tr><td align="right">21&nbsp;</td><td><a href="drracket_modes.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>modes</span></a></td></tr><tr><td align="right">22&nbsp;</td><td><a href="drracket_module-language-tools.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>module-<wbr></wbr>language-<wbr></wbr>tools</span></a></td></tr><tr><td align="right">23&nbsp;</td><td><a href="drracket_module-language.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>module-<wbr></wbr>language</span></a></td></tr><tr><td align="right">24&nbsp;</td><td><a href="drracket_tracing.html" class="tocviewlink" data-pltdoc="x"><span class="stt">drracket:<span class="mywbr"> &nbsp;</span>tracing</span></a></td></tr><tr><td align="right">25&nbsp;</td><td><a href="Backwards_Compatibility.html" class="tocviewlink" data-pltdoc="x">Backwards Compatibility</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,&quot;tocview_1&quot;);">&#9658;</a></td><td>2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Adding Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.1&nbsp;</td><td><a href="#%28part.__lang-based_.Languages_in_.Dr.Racket%29" class="tocviewlink" data-pltdoc="x"><span class="stt">#lang</span>-<wbr></wbr>based Languages in Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td align="right">2.2&nbsp;</td><td><a href="#%28part._.Adding_.Module-based_.Languages_to_.Dr.Racket%29" class="tocviewlink" data-pltdoc="x">Adding Module-<wbr></wbr>based Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td align="right">2.3&nbsp;</td><td><a href="#%28part._.Adding_.Arbitrary_.Languages_to_.Dr.Racket%29" class="tocviewlink" data-pltdoc="x">Adding Arbitrary Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td align="right">2.4&nbsp;</td><td><a href="#%28part._.Language_.Extensions%29" class="tocviewlink" data-pltdoc="x">Language Extensions</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">2.1<tt>&nbsp;</tt></span><a href="#%28part.__lang-based_.Languages_in_.Dr.Racket%29" class="tocsubseclink" data-pltdoc="x"><span class="stt">#lang</span>-<wbr></wbr>based Languages in Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td><span class="tocsublinknumber">2.2<tt>&nbsp;</tt></span><a href="#%28part._.Adding_.Module-based_.Languages_to_.Dr.Racket%29" class="tocsubseclink" data-pltdoc="x">Adding Module-<wbr></wbr>based Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td><span class="tocsublinknumber">2.3<tt>&nbsp;</tt></span><a href="#%28part._.Adding_.Arbitrary_.Languages_to_.Dr.Racket%29" class="tocsubseclink" data-pltdoc="x">Adding Arbitrary Languages to Dr<span class="mywbr"> &nbsp;</span>Racket</a></td></tr><tr><td><span class="tocsublinknumber">2.4<tt>&nbsp;</tt></span><a href="#%28part._.Language_.Extensions%29" class="tocsubseclink" data-pltdoc="x">Language Extensions</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, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="implementing-tools.html" title="backward to &quot;1 Implementing DrRacket Plugins&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;DrRacket Plugins&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Creating_New_Kinds_of_DrRacket_Frames.html" title="forward to &quot;3 Creating New Kinds of DrRacket Frames&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3 x-source-module="(lib &quot;scribblings/tools/tools.scrbl&quot;)" x-source-pkg="drracket" x-part-tag="&quot;adding-languages&quot;">2<tt>&nbsp;</tt><a name="(part._adding-languages)"></a>Adding Languages to DrRacket</h3><p><a name="(idx._(gentag._5._(lib._scribblings/tools/tools..scrbl)))"></a></p><h4 x-source-module="(lib &quot;scribblings/tools/tools.scrbl&quot;)" x-source-pkg="drracket" x-part-tag="&quot;_lang-based_Languages_in_DrRacket&quot;">2.1<tt>&nbsp;</tt><a name="(part.__lang-based_.Languages_in_.Dr.Racket)"></a><span class="stt">#lang</span>-based Languages in DrRacket</h4><p>If a language can be implemented as a module
(see <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=module.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._module%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">module</a></span> for details), then the simplest and
best way to use the language is via the &ldquo;Use the language
declared the in source&rdquo; checkbox in the <span class="ssansserif">Language</span> dialog.
In this case, DrRacket&rsquo;s appearance can still be customized to
the language; it uses <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-language%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">read-language</a></span> with these arguments
as the <span class="RktVar">key</span> argument to the <span class="RktVar">get-info</span> function to do so:</p><ul><li><p><a href="drracket_module-language-tools.html#%28elem._drracket~3atoolbar-buttons%29" data-pltdoc="x"><span class="RktSym">drracket:toolbar-buttons</span></a></p></li><li><p><a href="drracket_module-language-tools.html#%28elem._drracket~3aopt-out-toolbar-buttons%29" data-pltdoc="x"><span class="RktSym">drracket:opt-out-toolbar-buttons</span></a></p></li><li><p><a href="Editor_Modes.html#%28elem._definitions-text-surrogate%29" data-pltdoc="x"><span class="RktSym">definitions-text-surrogate</span></a></p></li><li><p><a href="#%28elem._drracket~3adefault-filters%29" data-pltdoc="x"><span class="RktSym">drracket:default-filters</span></a></p></li><li><p><a href="#%28elem._drracket~3adefault-extension%29" data-pltdoc="x"><span class="RktSym">drracket:default-extension</span></a></p></li><li><p><a href="#%28elem._drracket~3aindentation%29" data-pltdoc="x"><span class="RktSym">drracket:indentation</span></a></p></li><li><p><a href="#%28elem._color-lexer%29" data-pltdoc="x"><span class="RktSym">color-lexer</span></a></p></li></ul><p>If the call to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-language%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">read-language</a></span> raises an error, DrRacket logs the
error at the <span class="RktVar">debug</span> level to a logger with the name
<span class="RktVal">'</span><span class="RktVal">drracket-language</span> (see
<a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=logging.html&amp;version=6.7" class="Sq" data-pltdoc="x">Logging</a> for more
about how to follow specific loggers).</p><p><a name="(elem._color-lexer)"></a>When a language&rsquo;s <a name="(idx._(gentag._6._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVar">get-info</span> procedure responds to <span class="RktVal">'</span><span class="RktVal">color-lexer</span>, it
is expected to return a procedure suitable to pass as the <span class="RktVar">get-token</span>
argument to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=framework&amp;rel=Color.html%23%2528meth._%2528%2528%2528lib._framework%252Fmain..rkt%2529._color%7E3atext%7E3c%7E25%7E3e%2529._start-colorer%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">start-colorer</a></span>.</p><p><div class="SIntrapara">The recognized token styles (specified implicitly via <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=framework&amp;rel=Color.html%23%2528meth._%2528%2528%2528lib._framework%252Fmain..rkt%2529._color%7E3atext%7E3c%7E25%7E3e%2529._start-colorer%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">start-colorer</a></span>&rsquo;s
<span class="RktVar">token-sym-&gt;style</span> argument) are:
</div><div class="SIntrapara"><ul><li><p><a name="(idx._(gentag._7._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">symbol</span></p></li><li><p><a name="(idx._(gentag._8._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">keyword</span></p></li><li><p><a name="(idx._(gentag._9._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">comment</span></p></li><li><p><a name="(idx._(gentag._10._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">string</span></p></li><li><p><a name="(idx._(gentag._11._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">constant</span></p></li><li><p><a name="(idx._(gentag._12._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">parenthesis</span></p></li><li><p><a name="(idx._(gentag._13._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">error</span></p></li><li><p><a name="(idx._(gentag._14._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">other</span></p></li></ul></div><div class="SIntrapara">These precise colors for these identifiers are controlled by the preferences dialog in DrRacket.</div></p><p><a name="(elem._drracket~3adefault-filters)"></a>When a language&rsquo;s <a name="(idx._(gentag._15._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVar">get-info</span> procedure responds to
<span class="RktVal">'</span><span class="RktVal">drracket:default-filters</span>, it is expected to return
<span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="stt"> </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&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._list%252Fc%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">list/c</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span>.</p><p><div class="SIntrapara">These results are added as a prefix to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=framework&amp;rel=Finder.html%23%2528def._%2528%2528lib._framework%252Fmain..rkt%2529._finder%7E3adefault-filters%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">finder:default-filters</a></span>,
extending the default that DrRacket normally uses, namely:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktVal">[</span><span class="RktVal">"Racket Sources"</span><span class="hspace">&nbsp;</span><span class="RktVal">"*.rkt;*.scrbl;*.rktl;*.rktd;*.ss;*.scm"</span><span class="RktVal">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">[</span><span class="RktVal">"Any"</span><span class="hspace">&nbsp;</span><span class="RktVal">"*.*"</span><span class="RktVal">]</span><span class="RktVal">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><p class="SHistory">Added in version 1.2 of package <span class="stt">drracket</span>.</p></div></p><p><a name="(elem._drracket~3adefault-extension)"></a>When a language&rsquo;s <a name="(idx._(gentag._16._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVar">get-info</span> procedure responds to <span class="RktVal">'</span><span class="RktVal">drracket:default-extension</span>,
it is expected to return <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._and%252Fc%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">and/c</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="stt"> </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&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._not%252Fc%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">not/c</a></span><span class="stt"> </span><span class="RktVal">#rx"[.]"</span><span class="RktPn">)</span><span class="RktPn">)</span>; the result is used
as the default extension when saving files by setting <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=framework&amp;rel=Finder.html%23%2528def._%2528%2528lib._framework%252Fmain..rkt%2529._finder%7E3adefault-extension%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">finder:default-extension</a></span>.</p><p class="SHistory">Added in version 1.2 of package <span class="stt">drracket</span>.</p><p><div class="SIntrapara"><a name="(elem._drracket~3aindentation)"></a>When a language&rsquo;s <a name="(idx._(gentag._17._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktVar">get-info</span> procedure responds to <span class="RktVal">'</span><span class="RktVal">drracket:indentation</span>,
it is expected to return a function with this contract:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</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&amp;rel=Object_and_Class_Contracts.html%23%2528def._%2528%2528lib._racket%252Fclass..rkt%2529._is-a%7E3f%252Fc%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">is-a?/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=framework&amp;rel=Racket.html%23%2528def._%2528%2528lib._framework%252Fmain..rkt%2529._racket%7E3atext%7E3c%7E25%7E3e%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">racket:text&lt;%&gt;</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</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&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The function is used
to indent lines in DrRacket. It is called with the position containing the line to be
indented. It is expected to return the number of spaces that should appear at the beginning
of the line or <span class="RktVal">#f</span>. If <span class="RktVal">#f</span> is returned,
DrRacket uses the standard s-expression indentation rules.</div></p><p class="SHistory">Added in version 1.3 of package <span class="stt">drracket</span>.</p><p class="SHistory">Changed in version 1.1 of package <span class="stt">drracket</span>: Added support for <span class="RktVal">'</span><span class="RktVal">drracket:default-filters</span>
and <span class="RktVal">'</span><span class="RktVal">drracket:default-extension</span>.</p><h4 x-source-module="(lib &quot;scribblings/tools/tools.scrbl&quot;)" x-source-pkg="drracket" x-part-tag="&quot;Adding_Module-based_Languages_to_DrRacket&quot;">2.2<tt>&nbsp;</tt><a name="(part._.Adding_.Module-based_.Languages_to_.Dr.Racket)"></a>Adding Module-based Languages to DrRacket</h4><p><div class="SIntrapara">For backwards compatibility, DrRacket also supports
and
<span class="stt">info.rkt</span> file-based method for specifying
such languages. Include these definitions:
</div><div class="SIntrapara"><ul><li><p><a name="(idx._(gentag._18._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-modules</span>: This must be bound to a
list of collection path specifications or strings, one for
each language in the collection. Each collection path
specification is the quoted form of what might appear as
an argument to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span>, using the
<span class="stt">lib</span> argument (but without the <span class="stt">lib</span>). The
strings represent relative paths starting at the directory
containing the <span class="stt">info.rkt</span> file.  They are interpreted
like string arguments to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span>.</p></li><li><p><a name="(idx._(gentag._19._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-positions</span>: This must be bound to a
  list of language positions. Each language position
  corresponds to the position of the language in language
  dialog. Each language position is a list of strings whose
  length must be at least two.</p><p>If the first string is the same as
  <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=string-constants&amp;rel=index.html%23%2528form._%2528%2528lib._string-constants%252Fstring-constant..rkt%2529._string-constant%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">string-constant</a></span><span class="stt"> </span><span class="RktSym">teaching-languages</span><span class="RktPn">)</span>, then
  it is put into the &ldquo;Teaching Languages&rdquo; section
  of the dialog. Otherwise, it goes into the &ldquo;Other Languages&rdquo;
  section of the dialog.</p></li><li><p><a name="(idx._(gentag._20._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">get-drscheme-language-positions</span>: This must be bound to a list that contains a module path followed
  by a symbol. The module path and symbol are combined with
  <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Module_Names_and_Loading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._dynamic-require%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">dynamic-require</a></span> to obtain a list that is appended
  to the one from <span class="RktSym">drscheme-language-positions</span>, which
  allows access to <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=string-constants&amp;rel=index.html%23%2528mod-path._string-constants%2529&amp;version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">string-constants</span></a> to specify
  language positions.</p></li><li><p><a name="(idx._(gentag._21._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-numbers</span>: This is optional. If
  present, it must be a list of a list of numbers. Each list
  corresponds to a single language from this collection.
  Each number indicates a sorting order in the language
  dialog for the corresponding string in
  <span class="RktSym">drscheme-language-positions</span>. If absent, it defaults
  to a list of zeros that has the same length as
  <span class="RktSym">drscheme-language-positions</span>. This will rarely be correct.</p></li><li><p><a name="(idx._(gentag._22._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-one-line-summaries</span>: This is
  optional. If present, it must be a list of strings. Each
  string is displayed at the bottom of the language dialog
  when the corresponding language is selected.</p></li><li><p><a name="(idx._(gentag._23._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-urls</span>: This is
  optional. If present, it must be a list whose elements are
  either strings or <span class="RktVal">#f</span>.
  Clicking the corresponding language&rsquo;s name in
  the interactions window opens a web browser to the url.</p></li><li><p><a name="(idx._(gentag._24._(lib._scribblings/tools/tools..scrbl)))"></a><span class="RktSym">drscheme-language-readers</span>: This is optional. If
  present, it must be bound to a quoted list of module
  specifications (that is, a quoted version of the argument
  to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span>). Each
  specification must be a module that exports a function
  named <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-syntax%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">read-syntax</a></span>.  Each of these
  <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-syntax%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">read-syntax</a></span> functions must match Racket&rsquo;s
  <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=Reading.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._read-syntax%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">read-syntax</a></span> primitive&rsquo;s contract, but may
  read different concrete syntax.</p><p>If the module specification is a plain string, it
  represents a relative path starting at the directory
  containing the <span class="stt">info.rkt</span> file.  It is interpreted
  like the string arguments to <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span>.</p></li></ul></div><div class="SIntrapara">The lists must have the same length.</div></p><p><div class="SIntrapara">As an example, the <span style="font-style: italic">Essentials of Programming Languages</span>
language specification&rsquo;s <span class="stt">info.rkt</span> used to look like this:
</div><div class="SIntrapara"><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&amp;rel=Module_Syntax.html%23%2528part._hash-lang%2529&amp;version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace">&nbsp;</span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=raco&amp;rel=info_rkt.html&amp;version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">info</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=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=string-constants&amp;rel=index.html%23%2528form._%2528%2528lib._string-constants%252Fstring-constant..rkt%2529._string-constants%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">string-constants</a></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=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktVal">"EoPL Support"</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=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">drscheme-language-modules</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</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&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">"eopl-lang.rkt"</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=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">drscheme-language-positions</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</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&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</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&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=string-constants&amp;rel=index.html%23%2528form._%2528%2528lib._string-constants%252Fstring-constant..rkt%2529._string-constant%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">string-constant</a></span><span class="hspace">&nbsp;</span><span class="RktSym">teaching-languages</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"Essentials of Programming Languages"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">This <span class="stt">info.rkt</span> file indicates that there is a single
language in this collection. The module that implements the
language is the <span class="stt">eopl-lang.rkt</span> file in the same directory as
the <span class="stt">info.rkt</span> file. Additionally, the language dialog will contain
<span class="stt">Essentials of Programming Languages</span> as a potential
language. The use of the string constant
<span class="RktSym">teaching-languages</span> ensures that EoPL&rsquo;s language is
placed properly in foreign language versions of DrRacket.</div></p><p><div class="SIntrapara">For collections that define multiple (related) languages, if
the language-positions contain multiple strings, the
languages whose leading strings match are grouped together.
That is, if two languages have strings:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"My Text"</span><span class="hspace">&nbsp;</span><span class="RktVal">"First Language"</span><span class="RktVal">)</span></p></blockquote></div><div class="SIntrapara">and
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"My Text"</span><span class="hspace">&nbsp;</span><span class="RktVal">"Second Language"</span><span class="RktVal">)</span></p></blockquote></div><div class="SIntrapara">the two languages will be grouped together in the language
dialog.</div></p><h4 x-source-module="(lib &quot;scribblings/tools/tools.scrbl&quot;)" x-source-pkg="drracket" x-part-tag="&quot;Adding_Arbitrary_Languages_to_DrRacket&quot;">2.3<tt>&nbsp;</tt><a name="(part._.Adding_.Arbitrary_.Languages_to_.Dr.Racket)"></a>Adding Arbitrary Languages to DrRacket</h4><p>With some additional work, any language that can be compiled
to Racket is supported by the tools interface,
not just those that use standard configurations and
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=module.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._module%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">module</a></span>.</p><p>Each language is a class that implement the
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3alanguage~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:language&lt;%&gt;</a></span> interface.  DrRacket also
  provides two simpler interfaces:
  <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3amodule-based-language~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:module-based-language&lt;%&gt;</a></span> and
  <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3asimple-module-based-language~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:simple-module-based-language&lt;%&gt;</a></span>,
  and
  <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=mixins.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fclass-internal..rkt%2529._mixin%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">mixin</a></span>s
  <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3asimple-module-based-language-~3emodule-based-language-mixin%29%29" class="RktValLink" data-pltdoc="x">drracket:language:simple-module-based-language-&gt;module-based-language-mixin</a></span>
  and
  <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3amodule-based-language-~3elanguage-mixin%29%29" class="RktValLink" data-pltdoc="x">drracket:language:module-based-language-&gt;language-mixin</a></span>
  that build implementations of <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3alanguage~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:language&lt;%&gt;</a></span>s from these simpler interfaces.</p><p>Once you have an implementation of the
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3alanguage~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:language&lt;%&gt;</a></span> interface, call
<span class="RktSym"><a href="drracket_language-configuration.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage-configuration~3aadd-language%29%29" class="RktValLink" data-pltdoc="x">drracket:language-configuration:add-language</a></span> to add the language
to DrRacket.</p><p>Each language comes with its own type, called
<span class="stt">settings</span>. This can be any type the language
designer chooses, but to aid documentation, we call it
<span class="stt">settings</span> here. The settings type is expected to
contain parameters of the language, such as case
sensitivity, etc. The implementor of the language provides a
GUI so the user can configure the settings and all of the
language&rsquo;s operations accept a setting. DrRacket maintains
the current settings for each language.</p><h4 x-source-module="(lib &quot;scribblings/tools/tools.scrbl&quot;)" x-source-pkg="drracket" x-part-tag="&quot;Language_Extensions&quot;">2.4<tt>&nbsp;</tt><a name="(part._.Language_.Extensions)"></a>Language Extensions</h4><p>Some tools may require additional functionality from the
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3alanguage~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:language&lt;%&gt;</a></span> interface. The
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3aextend-language-interface%29%29" class="RktValLink" data-pltdoc="x">drracket:language:extend-language-interface</a></span>
function and the
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3aget-default-mixin%29%29" class="RktValLink" data-pltdoc="x">drracket:language:get-default-mixin</a></span>
mixin make this possible.</p><p>For example, the MrFlow tool expands a program, analyzes it
and then displays sets of values for each program point.
These sets of values should be rendered in the syntax of the
language that MrFlow analyzes. Since MrFlow doesn&rsquo;t
know which languages are available, it can call
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3aextend-language-interface%29%29" class="RktValLink" data-pltdoc="x">drracket:language:extend-language-interface</a></span>
to extend the <span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3alanguage~3c~25~3e%29%29" class="RktValLink" data-pltdoc="x">drracket:language:language&lt;%&gt;</a></span>
interface with a method for rendering sets of values and
provide a default implementation of that method. Tools that
know about MrFlow can then override the value rendering
method to provide a language-specific implementation of
value rendering.  Additionally, since the
<span class="RktSym"><a href="drracket_language.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3alanguage~3aget-default-mixin%29%29" class="RktValLink" data-pltdoc="x">drracket:language:get-default-mixin</a></span>
adds the default implementation for the value-set rendering
method, all languages at least have some form of value-set
rendering.</p><p>In some cases, it is important for one tool to avoid
depending on another in the manner above. For example, if a
tool that provides a new language provides an implementation
for the MrFlow-specific method, that tool may fail to load
if MrFlow is not present (Indeed, with the tool manager,
this can happen to any tool that depends on another in this
manner.)</p><p><div class="SIntrapara">To avoid this problem, consider writing your tool to first
check to see if the base method is available before
extending it. For example, if the MrFlow tool provides the
<span class="stt">render-value&lt;%&gt;</span> interface, then a tool that overrides
that method can first test to see if the superclass
implements that method before overriding it:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">my-language-mixin</span><span class="hspace">&nbsp;</span><span class="RktSym">%</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</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&amp;rel=if.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._if%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">if</a></span><span class="hspace">&nbsp;</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&amp;rel=objectutils.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fclass-internal..rkt%2529._implementation%7E3f%2529%2529&amp;version=6.7" class="RktValLink Sq" data-pltdoc="x">implementation?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">%</span><span class="hspace">&nbsp;</span><span class="RktSym">mrflow:render-value&lt;%&gt;</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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&amp;rel=createclass.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fclass-internal..rkt%2529._class%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">class</a></span><span class="hspace">&nbsp;</span><span class="RktSym">%</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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&amp;rel=createclass.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fclass-internal..rkt%2529._define%252Foverride%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">define/override</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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&amp;rel=objcreation.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fclass-internal..rkt%2529._super-new%2529%2529&amp;version=6.7" class="RktStxLink Sq" data-pltdoc="x">super-new</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">%</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div></p><p>To help test your tool, use the
<a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=drracket&amp;rel=extending-drracket.html%23%2528part._environment-variables%2529&amp;version=6.7" class="Sq" data-pltdoc="x"><span class="stt">PLTONLYTOOL</span></a>
environment variable to load it in isolation.</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, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="implementing-tools.html" title="backward to &quot;1 Implementing DrRacket Plugins&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;DrRacket Plugins&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Creating_New_Kinds_of_DrRacket_Frames.html" title="forward to &quot;3 Creating New Kinds of DrRacket Frames&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>