This file is indexed.

/usr/share/doc/racket/reference/Surrogates.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
<!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.12&nbsp;Surrogates</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="trait.html" class="tocviewlink" 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="" class="tocviewselflink" 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%2Fsurrogate..rkt%29._surrogate%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">surrogate</span></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.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="objectutils.html" title="backward to &quot;6.11 Object, Class, and Interface Utilities&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="mzlib_unit.html" title="forward to &quot;7 Units&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h4 x-source-module="(lib &quot;scribblings/reference/reference.scrbl&quot;)" x-source-pkg="racket-doc" x-part-tag="&quot;Surrogates&quot;">6.12<tt>&nbsp;</tt><a name="(part._.Surrogates)"></a><a name="(mod-path._racket/surrogate)"></a>Surrogates</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/surrogate</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/surrogate</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>The <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/surrogate</span></a> library provides an abstraction
for building an instance of the <a name="(tech._proxy._design._pattern)"></a><span style="font-style: italic">proxy design pattern</span>. The
pattern consists of two objects, a <span style="font-style: italic">host</span> and a
<span style="font-style: italic">surrogate</span> object. The host object delegates method calls to
its surrogate object. Each host has a dynamically assigned surrogate,
so an object can completely change its behavior merely by changing the
surrogate.</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/surrogate..rkt)._surrogate))"></a><span title="Provided from: racket/surrogate | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">surrogate</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">method-spec</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">method-spec</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="RktVar">method-id</span><span class="hspace">&nbsp;</span><span class="RktVar">arg-spec</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">method-id</span><span class="hspace">&nbsp;</span><span class="RktVar">arg-spec</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"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><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">method-id</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">default-expr</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;&nbsp;&nbsp;</span><span class="RktVar">arg-spec</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></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"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="RktVar">arg-spec</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="RktVar">id</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">id</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">If neither <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> nor <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 specified
for a <span class="RktVar">method-id</span>, then <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> is assumed.</div></p><p>The <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> form produces four values: a host mixin (a
procedure that accepts and returns a class), a host interface, a
surrogate class, and a surrogate interface.</p><p>The host mixin adds one additional field, <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span>, to its
argument. It also adds a getter method, <span class="RktSym">get-surrogate</span>, and a
setter method, <span class="RktSym">set-surrogate</span>, for changing the field. The
<span class="RktSym">set-surrogate</span> method accepts instances of the class returned by
the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> form or <span class="RktVal">#f</span>, and it updates the field with its
argument; then, <span class="RktSym">set-surrogate</span> calls the <span class="RktSym">on-disable-surrogate</span> on the
previous value of the field and <span class="RktSym">on-enable-surrogate</span> for the
new value of the field. The <span class="RktSym">get-surrogate</span> method returns the
current value of the field.</p><p>The host mixin has a single overriding method for each
<span class="RktVar">method-id</span> in the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> form. Each of these
methods is defined with a <span class="RktSym"><a href="lambda.html#%28form._%28%28quote._~23~25kernel%29._case-lambda%29%29" class="RktStxLink" data-pltdoc="x">case-lambda</a></span> with one arm for each
<span class="RktVar">arg-spec</span>. Each arm has the variables as arguments in the
<span class="RktVar">arg-spec</span>. The body of each method tests the
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> field. If it is <span class="RktVal">#f</span>, the method just
returns the result of invoking the super or inner method. If the
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> field is not <span class="RktVal">#f</span>, the corresponding method
of the object in the field is invoked. This method receives the same
arguments as the original method, plus two extras. The extra arguments
come at the beginning of the argument list. The first is the original
object. The second is a procedure that calls the super or inner method
(i.e., the method of the class that is passed to the mixin or an
extension, or the method in an overriding class), with the arguments
that the procedure receives.</p><p><div class="SIntrapara">For example, the host-mixin for this surrogate:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span><span class="hspace">&nbsp;</span><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="RktSym">m</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></div><div class="SIntrapara">will override the <span class="RktSym">m</span> method and call the surrogate like this:
</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="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define%2Foverride%29%29" class="RktStxLink" data-pltdoc="x">define/override</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">m</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace">&nbsp;</span><span class="RktVar">surrogate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="ivaraccess.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._send%29%29" class="RktStxLink" data-pltdoc="x">send</a></span><span class="hspace">&nbsp;</span><span class="RktVar">surrogate</span><span class="hspace">&nbsp;</span><span class="RktSym">m</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym"><a href="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._this%29%29" class="RktStxLink" data-pltdoc="x">this</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><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><span class="hspace">&nbsp;</span><span class="RktSym">m</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</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="createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._super%29%29" class="RktStxLink" data-pltdoc="x">super</a></span><span class="hspace">&nbsp;</span><span class="RktSym">m</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">where <span class="RktVar">surrogate</span> is bound to the value most recently passed
to the host mixin&rsquo;s <span class="RktVar">set-surrogate</span> method.</div></p><p>The host interface has the names <span class="RktSym">set-surrogate</span>,
<span class="RktSym">get-surrogate</span>, and each of the <span class="RktVar">method-id</span>s in the
original form.</p><p>The surrogate class has a single public method for each
<span class="RktVar">method-id</span> in the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> form. These methods are
invoked by classes constructed by the mixin. Each has a corresponding
method signature, as described in the above paragraph. Each method
just passes its argument along to the super procedure it receives.</p><p><div class="SIntrapara">In the example above, this is the <span class="RktVar">m</span> method in the surrogate class:
</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="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">m</span><span class="hspace">&nbsp;</span><span class="RktSym">original-object</span><span class="hspace">&nbsp;</span><span class="RktSym">original-super</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">original-super</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div></p><p>Note: if you derive a class from the surrogate class, do not both call
the <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> argument and the super method of the surrogate
class itself. Only call one or the other, since the default methods
call the <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> argument.</p><p>Finally, the interface contains all of the names specified in
surrogate&rsquo;s argument, plus <span class="RktSym">on-enable-surrogate</span> and
<span class="RktSym">on-disable-surrogate</span>. The class returned by
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fsurrogate..rkt%29._surrogate%29%29" class="RktStxLink" data-pltdoc="x">surrogate</a></span> implements this interface.</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="objectutils.html" title="backward to &quot;6.11 Object, Class, and Interface Utilities&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="mzlib_unit.html" title="forward to &quot;7 Units&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>