OK, Bert is having a little fun. Certainly good to learn that self is the default value.<br><br>But I wouldn&#39;t think of this as idiomatic smalltalk style.<br><br>I would prefer to follow &quot;Interesting Return Value&quot; [Beck]. I also factored out the return, since that is the same in both branches.<br>
<br>larger: anInteger<br>
        ^ self &gt; anInteger<br>               ifTrue: [self]<br>               ifFalse: [anInteger]<br>
<font color="#888888"><br></font><br><br><div class="gmail_quote">On Fri, Apr 23, 2010 at 4:39 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 23.04.2010, at 23:19, Herbert König wrote:<br>
&gt;<br>
&gt; Hi Randal,<br>
&gt;<br>
&gt;<br>
&gt; RLS&gt;   larger: anInteger<br>
&gt; RLS&gt;   ^self max: anInteger<br>
&gt; RLS&gt; Code re-use, bay-bee.<br>
&gt;<br>
&gt; true but couldn&#39;t resist to throw blocks at a newbie myself :-))<br>
<br>
</div>Sure, but two blocks are just too scary ;)<br>
Much more fun to figure out why this works:<br>
<br>
larger: anInteger<br>
        anInteger &gt; self ifTrue: [^ anInteger]<br>
<font color="#888888"><br>
- Bert -<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br>