This file is indexed.

/usr/share/doc/racket/reference/trait.html is in racket-doc 6.1-4.

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

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!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>6.6&nbsp;Traits</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../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,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="mzlib_class.html" class="tocviewselflink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9660;</a></td><td>6&nbsp;</td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.1&nbsp;</td><td><a href="createinterface.html" class="tocviewlink" data-pltdoc="x">Creating Interfaces</a></td></tr><tr><td align="right">6.2&nbsp;</td><td><a href="createclass.html" class="tocviewlink" data-pltdoc="x">Creating Classes</a></td></tr><tr><td align="right">6.3&nbsp;</td><td><a href="objcreation.html" class="tocviewlink" data-pltdoc="x">Creating Objects</a></td></tr><tr><td align="right">6.4&nbsp;</td><td><a href="ivaraccess.html" class="tocviewlink" data-pltdoc="x">Field and Method Access</a></td></tr><tr><td align="right">6.5&nbsp;</td><td><a href="mixins.html" class="tocviewlink" data-pltdoc="x">Mixins</a></td></tr><tr><td align="right">6.6&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Traits</a></td></tr><tr><td align="right">6.7&nbsp;</td><td><a href="Object_and_Class_Contracts.html" class="tocviewlink" data-pltdoc="x">Object and Class Contracts</a></td></tr><tr><td align="right">6.8&nbsp;</td><td><a href="objectequality.html" class="tocviewlink" data-pltdoc="x">Object Equality and Hashing</a></td></tr><tr><td align="right">6.9&nbsp;</td><td><a href="objectserialize.html" class="tocviewlink" data-pltdoc="x">Object Serialization</a></td></tr><tr><td align="right">6.10&nbsp;</td><td><a href="objectprinting.html" class="tocviewlink" data-pltdoc="x">Object Printing</a></td></tr><tr><td align="right">6.11&nbsp;</td><td><a href="objectutils.html" class="tocviewlink" data-pltdoc="x">Object, Class, and Interface Utilities</a></td></tr><tr><td align="right">6.12&nbsp;</td><td><a href="Surrogates.html" class="tocviewlink" data-pltdoc="x">Surrogates</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ftrait..rkt%29._trait~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait?</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ftrait..rkt%29._trait-~3emixin%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>&gt;mixin</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ftrait..rkt%29._trait-sum%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>sum</span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait-exclude%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>exclude</span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait-exclude-field%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>exclude-<wbr></wbr>field</span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait-alias%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>alias</span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait-rename%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>rename</span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Ftrait..rkt%29._trait-rename-field%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">trait-<wbr></wbr>rename-<wbr></wbr>field</span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.1&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.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="mixins.html" title="backward to &quot;6.5 Mixins&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="mzlib_class.html" title="up to &quot;6 Classes and Objects&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Object_and_Class_Contracts.html" title="forward to &quot;6.7 Object and Class Contracts&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h4 x-source-module="(lib &quot;scribblings/reference/reference.scrbl&quot;)" x-part-tag="&quot;trait&quot;">6.6<tt>&nbsp;</tt><a name="(part._trait)"></a><a name="(mod-path._racket/trait)"></a>Traits</h4><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/trait</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">base</span></span></td></tr></table></div><div class="SIntrapara">The bindings documented in this section are provided by the <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/trait</span></a> library, not <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/base</span></a> or <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket</span></a>.</div></p><p>A <a name="(tech._trait)"></a><span style="font-style: italic">trait</span> is a collection of methods that can be converted to
a <a href="mixins.html#%28tech._mixin%29" class="techoutside" data-pltdoc="x"><span class="techinside">mixin</span></a> and then applied to a <a href="mzlib_class.html#%28tech._clas%29" class="techoutside" data-pltdoc="x"><span class="techinside">class</span></a>. Before a trait is
converted to a mixin, the methods of a trait can be individually
renamed, and multiple traits can be merged to form a new trait.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-clause</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="stt">&nbsp;</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="specgrammar"><tr><td align="right" valign="baseline"><span class="RktVar">trait-clause</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public%29%29" class="RktStxLink" data-pltdoc="x">public</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._pubment%29%29" class="RktStxLink" data-pltdoc="x">pubment</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public-final%29%29" class="RktStxLink" data-pltdoc="x">public-final</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._override%29%29" class="RktStxLink" data-pltdoc="x">override</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._overment%29%29" class="RktStxLink" data-pltdoc="x">overment</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._override-final%29%29" class="RktStxLink" data-pltdoc="x">override-final</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment%29%29" class="RktStxLink" data-pltdoc="x">augment</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augride%29%29" class="RktStxLink" data-pltdoc="x">augride</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment-final%29%29" class="RktStxLink" data-pltdoc="x">augment-final</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">method-definition</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._field%29%29" class="RktStxLink" data-pltdoc="x">field</a></span><span class="hspace">&nbsp;</span><span class="RktVar">field-declaration</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit-field%29%29" class="RktStxLink" data-pltdoc="x">inherit-field</a></span><span class="hspace">&nbsp;</span><span class="RktVar">maybe-renamed</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Creates a <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a>.  The body of a <span class="RktSym">trait</span> form is similar to the
body of a <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%2A%29%29" class="RktStxLink" data-pltdoc="x">class*</a></span> form, but restricted to non-private method
definitions.  In particular, the grammar of
<span class="RktVar">maybe-renamed</span>, <span class="RktVar">method-definition</span>, and
<span class="RktVar">field-declaration</span> are the same as for <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%2A%29%29" class="RktStxLink" data-pltdoc="x">class*</a></span>, and
every <span class="RktVar">method-definition</span> must have a corresponding declaration
(one of <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public%29%29" class="RktStxLink" data-pltdoc="x">public</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._override%29%29" class="RktStxLink" data-pltdoc="x">override</a></span>, etc.).  As in
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%29%29" class="RktStxLink" data-pltdoc="x">class</a></span>, uses of method names in direct calls, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._super%29%29" class="RktStxLink" data-pltdoc="x">super</a></span>
calls, and <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inner%29%29" class="RktStxLink" data-pltdoc="x">inner</a></span> calls depend on bringing method names into
scope via <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span>,
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span>, and other method declarations in the same
trait; an exception, compared to <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%29%29" class="RktStxLink" data-pltdoc="x">class</a></span> is that
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._overment%29%29" class="RktStxLink" data-pltdoc="x">overment</a></span> binds a method name only in the corresponding
method, and not in other methods of the same trait. Finally, macros
such as <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public%2A%29%29" class="RktStxLink" data-pltdoc="x">public*</a></span> and <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span> work in
<span class="RktSym">trait</span> as in <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%29%29" class="RktStxLink" data-pltdoc="x">class</a></span>.</div></p><p>External identifiers in <span class="RktSym">trait</span>, <span class="RktSym">trait-exclude</span>,
<span class="RktSym">trait-exclude-field</span>, <span class="RktSym">trait-alias</span>,
<span class="RktSym">trait-rename</span>, and <span class="RktSym">trait-rename-field</span> forms are
subject to binding via <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define-member-name%29%29" class="RktStxLink" data-pltdoc="x">define-member-name</a></span> and
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define-local-member-name%29%29" class="RktStxLink" data-pltdoc="x">define-local-member-name</a></span>. Although <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._private%29%29" class="RktStxLink" data-pltdoc="x">private</a></span> methods
or fields are not allowed in a <span class="RktSym">trait</span> form, they can be
simulated by using a <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public%29%29" class="RktStxLink" data-pltdoc="x">public</a></span> or <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._field%29%29" class="RktStxLink" data-pltdoc="x">field</a></span> declaration and
a name whose scope is limited to the <span class="RktSym">trait</span> form.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/trait..rkt)._trait~3f))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait?</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a trait, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/trait..rkt)._trait-~3emixin))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-&gt;mixin</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">tr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="objectutils.html#%28def._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class~3f%29%29" class="RktValLink" data-pltdoc="x">class?</a></span><span class="hspace">&nbsp;</span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="RktPn"> .</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="objectutils.html#%28def._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class~3f%29%29" class="RktValLink" data-pltdoc="x">class?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">tr</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">trait?</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> to a <a href="mixins.html#%28tech._mixin%29" class="techoutside" data-pltdoc="x"><span class="techinside">mixin</span></a>, which can be applied to a
<a href="mzlib_class.html#%28tech._clas%29" class="techoutside" data-pltdoc="x"><span class="techinside">class</span></a> to produce a new <a href="mzlib_class.html#%28tech._clas%29" class="techoutside" data-pltdoc="x"><span class="techinside">class</span></a>. An expression of the form</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">trait-&gt;mixin</span></td></tr><tr><td><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">trait</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktVar">trait-clause</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>is equivalent to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</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="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%29%29" class="RktStxLink" 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;</span><span class="RktVar">trait-clause</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="objcreation.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._super-new%29%29" class="RktStxLink" data-pltdoc="x">super-new</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>Normally, however, a trait&rsquo;s methods are changed and combined with
other traits before converting to a mixin.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/trait..rkt)._trait-sum))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-sum</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">tr</span><span class="hspace">&nbsp;</span><span class="RktMeta">...+</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">trait?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">tr</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">trait?</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that combines all of the methods of the given
<span class="RktVar">tr</span>s. For example,</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">t1</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">trait</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">m1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">t2</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">trait</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">m2</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">t3</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">trait-sum</span><span class="hspace">&nbsp;</span><span class="RktSym">t1</span><span class="hspace">&nbsp;</span><span class="RktSym">t2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>creates a trait <span class="RktSym">t3</span> that is equivalent to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">trait</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">m1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Fpublic%29%29" class="RktStxLink" data-pltdoc="x">define/public</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">m2</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>but <span class="RktSym">t1</span> and <span class="RktSym">t2</span> can still be used individually or
combined with other traits.</p><p>When traits are combined with <span class="RktSym">trait-sum</span>, the combination
drops <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span>,
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span>, and <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit-field%29%29" class="RktStxLink" data-pltdoc="x">inherit-field</a></span> declarations when a
definition is supplied for the same method or field name by another
trait. The <span class="RktSym">trait-sum</span> operation fails (the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised) if any of the traits to combine define a
method or field with the same name, or if an <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span> or
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span> declaration to be dropped is inconsistent with
the supplied definition. In other words, declaring a method with
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span>, or <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span>,
does not count as defining the method; at the same time, for example,
a trait that contains an <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span> declaration for a
method <span class="RktSym">m</span> cannot be combined with a trait that defines
<span class="RktSym">m</span> as <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment%29%29" class="RktStxLink" data-pltdoc="x">augment</a></span>, since no class could satisfy the
requirements of both <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment%29%29" class="RktStxLink" data-pltdoc="x">augment</a></span> and <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span> when
the trait is later converted to a mixin and applied to a class.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait-exclude))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-exclude</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-expr</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a new <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that is like the <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> result of
<span class="RktVar">trait-expr</span>, but with the definition of a method named by
<span class="RktVar">id</span> removed; as the method definition is removed, either an
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span>, or <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span>
declaration is added:</div></p><ul><li><p>A method declared with <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public%29%29" class="RktStxLink" data-pltdoc="x">public</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._pubment%29%29" class="RktStxLink" data-pltdoc="x">pubment</a></span>, or
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._public-final%29%29" class="RktStxLink" data-pltdoc="x">public-final</a></span> is replaced with an <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span>
declaration.</p></li><li><p>A method declared with <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._override%29%29" class="RktStxLink" data-pltdoc="x">override</a></span> or <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._override-final%29%29" class="RktStxLink" data-pltdoc="x">override-final</a></span>
is replaced with an <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Fsuper%29%29" class="RktStxLink" data-pltdoc="x">inherit/super</a></span> declaration.</p></li><li><p>A method declared with <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment%29%29" class="RktStxLink" data-pltdoc="x">augment</a></span>, <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augride%29%29" class="RktStxLink" data-pltdoc="x">augride</a></span>, or
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._augment-final%29%29" class="RktStxLink" data-pltdoc="x">augment-final</a></span> is replaced with an <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%2Finner%29%29" class="RktStxLink" data-pltdoc="x">inherit/inner</a></span> declaration.</p></li><li><p>A method declared with <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._overment%29%29" class="RktStxLink" data-pltdoc="x">overment</a></span> is not replaced
with any <span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit%29%29" class="RktStxLink" data-pltdoc="x">inherit</a></span> declaration.</p></li></ul><p>If the trait produced by <span class="RktVar">trait-expr</span> has no method definition for
<span class="RktVar">id</span>, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait-exclude-field))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-exclude-field</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-expr</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a new <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that is like the <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> result of
<span class="RktVar">trait-expr</span>, but with the definition of a field named by
<span class="RktVar">id</span> removed; as the field definition is removed, an
<span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._inherit-field%29%29" class="RktStxLink" data-pltdoc="x">inherit-field</a></span> declaration is added.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait-alias))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-alias</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-expr</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">new-id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a new <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that is like the <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> result of
<span class="RktVar">trait-expr</span>, but the definition and declaration of the method
named by <span class="RktVar">id</span> is duplicated with the name <span class="RktVar">new-id</span>. The
consistency requirements for the resulting trait are the same as for
<span class="RktSym">trait-sum</span>, otherwise the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised. This
operation does not rename any other use of <span class="RktVar">id</span>, such as in
method calls (even method calls to <span class="RktSym">identifier</span> in the cloned
definition for <span class="RktVar">new-id</span>).</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait-rename))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-rename</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-expr</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">new-id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a new <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that is like the <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> result of
<span class="RktVar">trait-expr</span>, but all definitions and references to methods
named <span class="RktVar">id</span> are replaced by definitions and references to
methods named by <span class="RktVar">new-id</span>. The consistency requirements for the
resulting trait are the same as for <span class="RktSym">trait-sum</span>, otherwise the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/trait..rkt)._trait-rename-field))"></a><span title="Provided from: racket/trait | Package: base"><span class="RktSym"><span class="RktSymDef RktSym">trait-rename-field</span></span></span><span class="hspace">&nbsp;</span><span class="RktVar">trait-expr</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktVar">new-id</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a new <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> that is like the <a href="#%28tech._trait%29" class="techoutside" data-pltdoc="x"><span class="techinside">trait</span></a> result of
<span class="RktVar">trait-expr</span>, but all definitions and references to fields
named <span class="RktVar">id</span> are replaced by definitions and references to fields
named by <span class="RktVar">new-id</span>. The consistency requirements for the
resulting trait are the same as for <span class="RktSym">trait-sum</span>, otherwise the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised.</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, &quot;6.1&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.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="mixins.html" title="backward to &quot;6.5 Mixins&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="mzlib_class.html" title="up to &quot;6 Classes and Objects&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Object_and_Class_Contracts.html" title="forward to &quot;6.7 Object and Class Contracts&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>