<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 4, 2013 at 8:07 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-10-04, at 16:58, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>

<br>
&gt; Well, the new is taller and slimmer, with a consistent application of<br>
&gt; Rectangular Block, a &quot;best practice&quot; formatting pattern.  I&#39;ve never<br>
&gt; found short and squat (and inconsistent!) to be easier to read than<br>
&gt; tall &amp; slim, but I guess we all have our visual acuity developed the<br>
&gt; way it is developed.<br>
&gt; method.<br>
&gt;<br>
&gt; That&#39;s why I&#39;d suggest to simply use pretty print when coming across a<br>
&gt; method you find hard-to-read.<br>
&gt;<br>
&gt; Also, if I make a small, one-line change to a method, I won&#39;t reformat<br>
&gt; it out of respect for the prior author&#39;s format.  But if changes are<br>
&gt; significant, it becomes &quot;my&quot; code and time is too scarce anyway to<br>
&gt; spend time manually formatting code.  A Shift+Command+S just prior to<br>
&gt; saving converts it to RB for me, which is easiest for most people to<br>
&gt; read because, according to the pattern, people see things in<br>
&gt; rectangles.<br>
<br>
<br>
</div>Compare<br>
<br>
        [ undeclared at: sym put: nil ]<br>
                on: AttemptToWriteReadOnlyGlobal<br>
<div class="im">                do: [ :noti | noti resume: true ]<br>
<br>
</div>to:<br>
<br>
        [ undeclared<br>
                at: sym<br>
                put: nil ]<br>
                on: AttemptToWriteReadOnlyGlobal<br>
<div class="im">                do: [ :noti | noti resume: true ]<br>
<br>
</div>Isn&#39;t the first one much more &quot;rectangular&quot; and easier to read? I find the indentation in the second one irritating.<br></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
- Bert -<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; On Fri, Oct 4, 2013 at 6:06 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
&gt;&gt; On 2013-10-03, at 23:02, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; The reformatting caused almost all lines to be dif&#39;d.  The only change<br>
&gt;&gt;&gt; is handling AttemptToWriteReadOnlyGlobal on the at:put:.<br>
&gt;&gt;<br>
&gt;&gt; I find the compact form the code had before a lot more readable.<br>
&gt;&gt;<br>
&gt;&gt; - Bert -<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Oct 3, 2013 at 2:35 PM,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; Chris Muller uploaded a new version of Compiler to project The Trunk:<br>
&gt;&gt;&gt;&gt; <a href="http://source.squeak.org/trunk/Compiler-cmm.275.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-cmm.275.mcz</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Name: Compiler-cmm.275<br>
&gt;&gt;&gt;&gt; Author: cmm<br>
&gt;&gt;&gt;&gt; Time: 3 October 2013, 2:34:56.409 pm<br>
&gt;&gt;&gt;&gt; UUID: 9d002330-e75e-436f-8699-b29413e98e81<br>
&gt;&gt;&gt;&gt; Ancestors: Compiler-nice.274<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; When loading code, don&#39;t blow up just because of an undeclared ref.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; =============== Diff against Compiler-nice.274 ===============<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Item was changed:<br>
&gt;&gt;&gt;&gt; ----- Method: Encoder&gt;&gt;undeclared: (in category &#39;encoding&#39;) -----<br>
&gt;&gt;&gt;&gt; + undeclared: name<br>
&gt;&gt;&gt;&gt; - undeclared: name<br>
&gt;&gt;&gt;&gt;       | sym |<br>
&gt;&gt;&gt;&gt;       requestor interactive ifTrue:<br>
&gt;&gt;&gt;&gt; +               [ requestor requestor == #error: ifTrue: [ requestor error: &#39;Undeclared&#39; ].<br>
&gt;&gt;&gt;&gt; +               ^ self notify: &#39;Undeclared&#39; ].<br>
&gt;&gt;&gt;&gt; -               [requestor requestor == #error: ifTrue:<br>
&gt;&gt;&gt;&gt; -                       [requestor error: &#39;Undeclared&#39;].<br>
&gt;&gt;&gt;&gt; -                ^self notify: &#39;Undeclared&#39;].<br>
&gt;&gt;&gt;&gt;       &quot;Allow knowlegeable clients to squash the undeclared warning if they want (e.g.<br>
&gt;&gt;&gt;&gt;        Diffing pretty printers that are simply formatting text).  As this breaks<br>
&gt;&gt;&gt;&gt;        compilation it should only be used by clients that want to discard the result<br>
&gt;&gt;&gt;&gt;        of the compilation.  To squash the warning use e.g.<br>
&gt;&gt;&gt;&gt;               [Compiler format: code in: class notifying: nil decorated: false]<br>
&gt;&gt;&gt;&gt;                       on: UndeclaredVariableWarning<br>
&gt;&gt;&gt;&gt;                       do: [:ex| ex resume: false]&quot;<br>
&gt;&gt;&gt;&gt;       sym := name asSymbol.<br>
&gt;&gt;&gt;&gt; +       ^ (UndeclaredVariableWarning new<br>
&gt;&gt;&gt;&gt; +               name: name<br>
&gt;&gt;&gt;&gt; +               selector: selector<br>
&gt;&gt;&gt;&gt; +               class: cue getClass) signal<br>
&gt;&gt;&gt;&gt; -       ^(UndeclaredVariableWarning new name: name selector: selector class: cue getClass) signal<br>
&gt;&gt;&gt;&gt;               ifTrue:<br>
&gt;&gt;&gt;&gt; +                       [ | undeclared |<br>
&gt;&gt;&gt;&gt; -                       [| undeclared |<br>
&gt;&gt;&gt;&gt;                       undeclared := cue environment undeclared.<br>
&gt;&gt;&gt;&gt; +                       [ undeclared<br>
&gt;&gt;&gt;&gt; +                               at: sym<br>
&gt;&gt;&gt;&gt; +                               put: nil ]<br>
&gt;&gt;&gt;&gt; +                               on: AttemptToWriteReadOnlyGlobal<br>
&gt;&gt;&gt;&gt; +                               do: [ : noti | noti resume: true ].<br>
&gt;&gt;&gt;&gt; +                       self<br>
&gt;&gt;&gt;&gt; +                               global: (undeclared associationAt: sym)<br>
&gt;&gt;&gt;&gt; +                               name: sym ]<br>
&gt;&gt;&gt;&gt; -                       undeclared at: sym put: nil.<br>
&gt;&gt;&gt;&gt; -                       self global: (undeclared associationAt: sym) name: sym]<br>
&gt;&gt;&gt;&gt;               ifFalse:<br>
&gt;&gt;&gt;&gt; +                       [ self<br>
&gt;&gt;&gt;&gt; +                               global: (Association key: sym)<br>
&gt;&gt;&gt;&gt; +                               name: sym ]!<br>
&gt;&gt;&gt;&gt; -                       [self global: (Association key: sym) name: sym]!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>