wow - i got that wrong. <div><br></div><div>check this example from the reference</div><div><br></div><div><a href="http://docs.racket-lang.org/reference/createclass.html#(form._((lib._racket/private/class-internal..rkt)._augment))">http://docs.racket-lang.org/reference/createclass.html#(form._((lib._racket/private/class-internal..rkt)._augment))</a></div>
<div><br></div><div><div>#lang racket</div><div><br></div><div>(define buzzer%</div><div>  (class object%</div><div>    (super-new)</div><div>    (define/pubment (buzz)</div><div>      (displayln &quot;bzzzt&quot;)</div><div>
      (inner (void) buzz))))</div><div>(define loud-buzzer%</div><div>  (class buzzer%</div><div>    (super-new)</div><div>    (define (buzz)</div><div>      (displayln &quot;BZZZZZZZZZT&quot;))</div><div>    (augment buzz)))</div>
<div>(send (new buzzer%) buzz)</div><div>;bzzzt</div><div>(send (new loud-buzzer%) buzz)</div><div>;bzzzt</div><div>;BZZZZZZZZZT</div><div><br></div><div>s.</div><div><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 8:15 AM, Stephen De Gabrielle <span dir="ltr">&lt;<a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The way I read it was the new function gets called instead of inner;<div><br></div><div><div class="im"><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">#lang racket</span></font></div>
<div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)"><br>
</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">(define a%</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">  (class object%</span></font></div>

<div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">    (super-new)</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">    (define/pubment (hello)</span></font></div>

</div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">      (printf &quot;Hello &quot;)</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">      (inner 0)</span></font></div>

<div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">      (printf &quot;!~n &quot;))</span></font><span style="background-color:rgba(255,255,255,0);line-height:normal;font-size:small">))</span></div>

</div><div><br></div><div><br dir="ltr"></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">(define b%</span></font><br></div><div><div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">  (class a%</span></font></div>

<div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">    (super-new)</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">    (define/augment (hello greg)</span></font></div>

<div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">      ;Call super here?</span></font></div><div><font><span style="line-height:normal;background-color:rgba(255,255,255,0)">      (printf &quot; ~a ~n&quot; greg))))</span></font></div>

</div><div><br></div>(send (new b%) hello &quot;Bob&quot;)</div><div>-&gt; Hello Bob!</div><div><br></div><div>Is this right?</div><div><br></div><div>Cheers, <span></span></div><div>Stephen</div><div class="HOEnZb"><div class="h5">
<div><br><div><br><br>
On Monday, September 24, 2012, Gregory Woodhouse  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I am trying to understand how augmentable methods (as described in section 13.5 of The Guide) work.<div>

<br></div><div><span style="text-align:left;font-family:serif">Between the extremes of allowing arbitrary overriding and disallowing overriding entirely, the class system also supports Beta-style </span><span style="text-align:left;font-style:italic;font-family:serif">augmentable</span><span style="text-align:left;font-family:serif"> methods [</span><a style="text-align:left;font-family:serif">Goldberg04</a><span style="text-align:left;font-family:serif">]. A method declared with </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">pubment</a></span><span style="text-align:left;font-family:serif"> is like </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">public</a></span><span style="text-align:left;font-family:serif">, but the method cannot be overridden in subclasses; it can be augmented only. A </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">pubment</a></span><span style="text-align:left;font-family:serif"> method must explicitly invoke an augmentation (if any) using </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">inner</a></span><span style="text-align:left;font-family:serif">; a subclass augments the method using </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">augment</a></span><span style="text-align:left;font-family:serif">, instead of </span><span style="text-align:left;color:rgb(38,38,128);font-family:monospace"><a style="text-decoration:none;color:black">override</a></span><span style="text-align:left;font-family:serif">.</span><br>

<div><br></div><div><br></div><div>From this I conclude that if, for example, I have a class a% and a subclass b% and I want to augment a method of a% in b% I need to call inner in the definition of the method in a%, not b%. Something like this</div>

</div><div><br></div><div><div>#lang racket</div><div><br></div><div>(define a%</div><div>  (class object%</div><div>    (super-new)</div><div>    (define/pubment (hello)</div><div>      (printf &quot;Hello~n&quot;)</div>

<div>      (inner 0))))</div><div><br></div><div>(define b%</div><div>  (class a%</div><div>    (super-new)</div><div>    (define/augment (hello)</div><div>      ;Call super here?</div><div>      (printf &quot;, world!~n&quot;))))</div>

</div><div><br></div><div><br></div><div>but this gives me an error (not really a surprise). My assumption is that super should be used in the subclass when overriding a method, but if a method is to be augmented any potential code in an augmenting class should be invoked from the superclass and super is not used in the subclass. Obviously, I&#39;m missing something.</div>

</div></blockquote></div></div><br><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div> </div><div>--</div><div>Stephen De Gabrielle</div><div><a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a></div>
<div>Telephone <a href="tel:%2B44%20%280%2920%2085670911" value="+442085670911" target="_blank">+44 (0)20 85670911</a></div>
<div>Mobile        <a href="tel:%2B44%20%280%2979%2085189045" value="+447985189045" target="_blank">+44 (0)79 85189045</a></div><div><a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a></div>
<div>----</div><div>Professor: Oh God! I clicked without reading! </div>
<div>Cubert: And I slightly modified something I own! </div><div>Professor: We&#39;re monsters!</div><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div> </div><div>--</div><div>Stephen De Gabrielle</div><div><a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a></div>
<div>Telephone +44 (0)20 85670911</div><div>Mobile        +44 (0)79 85189045</div><div><a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a></div><div>----</div><div>Professor: Oh God! I clicked without reading! </div>
<div>Cubert: And I slightly modified something I own! </div><div>Professor: We&#39;re monsters!</div><br>
</div></div>