<div dir="ltr">Would you have the source code for the *.Mod files Dieter?<div><br></div><div>Jan.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 25, 2017 at 10:00 AM, Dieter <span dir="ltr"><<a href="mailto:d.gloetzel@web.de" target="_blank">d.gloetzel@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="m_9183498231220295030moz-cite-prefix">Just to remind you, that there exists a
      nice prettyprinter written by G. Feldmann, running on ETHOberon
      Windows plugin.<br>
      Regards,<br>
      Dieter<div><div class="h5"><br>
      <br>
      Am 25.07.2017 um 01:44 schrieb Hans Klaver:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      
      Jörg wrote:
      <div><br>
        <div>
          <blockquote type="cite">
            <div><span style="font-family:Menlo-Regular;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Indentation is indeed a
                totally personal thing.</span><br style="font-family:Menlo-Regular;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
            </div>
          </blockquote>
          <br>
        </div>
        <div>It is interesting to catalogue the different indentation
          styles used by some well known (and less well known)
          programmers of Oberon and Component Pascal source code. With
          one of the exercises of the Reiser & Wirth book as
          material I wrote out various indentation styles. 
          <div><br>
          </div>
          <div>Crudely four styles of indentation can be
            discerned:</div>
          <div>- No indentation (Daniel)</div>
          <div>- Minimal indentation (Reiser / Mössenböck); the
            difference between the two is in the indentation of
            declarations (e.g. VAR) at the procedure level</div>
          <div>- Classical indentation (Wirth & Gutknecht);
            has the most consistent indentation of scope levels.</div>
          <div>- Knuth indentation (Knuth / Campbell); also
            quite consistent, but rather convoluted.<br>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>
              <div>MODULE M;  (* After Exercise 6.4 (p. 85) from Reiser
                & Wirth, Programming in Oberon *)</div>
              <div>IMPORT Out;</div>
              <div>VAR i, j: INTEGER;</div>
              <div>PROCEDURE A*;</div>
              <div>VAR i: INTEGER;</div>
              <div>PROCEDURE B(VAR i, j: INTEGER);</div>
              <div>VAR k: INTEGER;</div>
              <div>BEGIN k := i; i := j; j := k END B;</div>
              <div>BEGIN i := 2; B(i, j)</div>
              <div>END A;</div>
              <div>PROCEDURE C*;</div>
              <div>BEGIN A; i := 2*j; </div>
              <div>Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div>
              <div>END C;</div>
              <div>BEGIN</div>
              <div>END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>*********)</div>
              <div><br>
              </div>
              <div>MODULE M;  (* Daniel, <a href="http://www.waltzballs.org/other/prog.html#track" target="_blank">http://www.waltzballs.org/<wbr>other/prog.html#track</a> *)</div>
              <div>IMPORT Out;</div>
              <div>VAR i,j:INTEGER;</div>
              <div><br>
              </div>
              <div>PROCEDURE A*;</div>
              <div>VAR i:INTEGER;</div>
              <div><br>
              </div>
              <div>PROCEDURE B(VAR i,j:INTEGER);</div>
              <div>VAR k:INTEGER;</div>
              <div>BEGIN k:=i;i:=j;j:=kEND B;</div>
              <div><br>
              </div>
              <div>BEGIN i:=2;B(i,j)</div>
              <div>END A;</div>
              <div><br>
              </div>
              <div>PROCEDURE C*;</div>
              <div>BEGIN A;i:=2*j; </div>
              <div>Out.Int(i,5);Out.Int(j,5);Out.<wbr>Ln</div>
              <div>END C;</div>
              <div><br>
              </div>
              <div>BEGIN</div>
              <div>END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>*********)</div>
              <div><br>
              </div>
              <div>MODULE M;  (* M. Reiser, The Oberon System </div>
              <div>     and M. Reiser & N. Wirth, Programming in
                Oberon *)</div>
              <div>IMPORT Out;</div>
              <div>VAR i, j: INTEGER; </div>
              <div><br>
              </div>
              <div>PROCEDURE A*;</div>
              <div>VAR i: INTEGER;</div>
              <div><br>
              </div>
              <div>    PROCEDURE B(VAR i, j: INTEGER);</div>
              <div>    VAR k: INTEGER;</div>
              <div>    BEGIN </div>
              <div>        k := i; i := j; j := k </div>
              <div>    END B;</div>
              <div><br>
              </div>
              <div>BEGIN </div>
              <div>    i := 2; B(i, j)</div>
              <div>END A;</div>
              <div><br>
              </div>
              <div>PROCEDURE C*;</div>
              <div>BEGIN </div>
              <div>    A; i := 2*j; </div>
              <div>    Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div>
              <div>END C;</div>
              <div><br>
              </div>
              <div>BEGIN</div>
              <div>END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>********)</div>
              <div><br>
              </div>
              <div>MODULE M;  (* H. Mössenböck, Object Oriented
                Programming in Oberon-2 *)</div>
              <div>IMPORT Out;</div>
              <div>VAR i, j: INTEGER;</div>
              <div><br>
              </div>
              <div>PROCEDURE A*;</div>
              <div>    VAR i: INTEGER;</div>
              <div><br>
              </div>
              <div>    PROCEDURE B(VAR i, j: INTEGER);</div>
              <div>        VAR k: INTEGER;</div>
              <div>    BEGIN </div>
              <div>        k := i; i := j; j := k </div>
              <div>    END B;</div>
              <div><br>
              </div>
              <div>BEGIN </div>
              <div>    i := 2; B(i, j)</div>
              <div>END A;</div>
              <div><br>
              </div>
              <div>PROCEDURE C*;</div>
              <div>BEGIN </div>
              <div>    A; i := 2*j; </div>
              <div>    Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div>
              <div>END C;</div>
              <div><br>
              </div>
              <div>BEGIN</div>
              <div>END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>*********)</div>
              <div><br>
              </div>
              <div>MODULE M;  (* Wirth & Gutknecht, Project Oberon
                *)</div>
              <div>    IMPORT Out;</div>
              <div>    VAR i, j: INTEGER;</div>
              <div><br>
              </div>
              <div>    PROCEDURE A*;</div>
              <div>        VAR i: INTEGER;</div>
              <div><br>
              </div>
              <div>        PROCEDURE B(VAR i, j: INTEGER);</div>
              <div>            VAR k: INTEGER;</div>
              <div>        BEGIN </div>
              <div>            k := i; i := j; j := k </div>
              <div>        END B;</div>
              <div><br>
              </div>
              <div>    BEGIN </div>
              <div>        i := 2; B(i, j)</div>
              <div>    END A;</div>
              <div><br>
              </div>
              <div>    PROCEDURE C*;</div>
              <div>    BEGIN </div>
              <div>        A; i := 2*j; </div>
              <div>        Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div>
              <div>    END C;</div>
              <div><br>
              </div>
              <div>BEGIN</div>
              <div>END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>*********)</div>
              <div><br>
              </div>
              <div>MODULE M;  (* Knuth. E.g. see: <a href="http://brokestream.com/tex.pdf" target="_blank">http://brokestream.com/tex.pdf</a><wbr> *)</div>
              <div>    IMPORT Out;</div>
              <div>    VAR i, j: INTEGER;</div>
              <div><br>
              </div>
              <div>    PROCEDURE A*;</div>
              <div>        VAR i: INTEGER;</div>
              <div><br>
              </div>
              <div>        PROCEDURE B(VAR i, j: INTEGER);</div>
              <div>            VAR k: INTEGER;</div>
              <div>            BEGIN k := i; i := j; j := k </div>
              <div>            END B;</div>
              <div><br>
              </div>
              <div>        BEGIN i := 2; B(i, j)</div>
              <div>        END A;</div>
              <div><br>
              </div>
              <div>    PROCEDURE C*;</div>
              <div>        BEGIN A; i := 2*j; </div>
              <div>        Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div>
              <div>        END C;</div>
              <div><br>
              </div>
              <div>    BEGIN</div>
              <div>    END M.C</div>
              <div><br>
              </div>
              <div>(*****************************<wbr>*********)</div>
              <div><br>
              </div>
              <div>
                <div>MODULE M;  (* R. Campbell, Subsystem Lib for
                  BlackBox Component Framework, </div>
                <div>   see the Component Pascal Collection, <a href="http://www.zinnamturm.eu/" target="_blank">http://www.zinnamturm.eu/</a> *)</div>
                <div>IMPORT Out;</div>
                <div>VAR </div>
                <div>    i, j : INTEGER;</div>
                <div><br>
                </div>
                <div>PROCEDURE A*;</div>
                <div>    VAR </div>
                <div>        i  : INTEGER;</div>
                <div><br>
                </div>
                <div>    PROCEDURE B(VAR i, j : INTEGER);</div>
                <div>        VAR </div>
                <div>            k  : INTEGER;</div>
                <div>        BEGIN </div>
                <div>            k := i;  i := j;  j := k </div>
                <div>        END B;</div>
                <div><br>
                </div>
                <div>    BEGIN </div>
                <div>        i := 2; </div>
                <div>        B(i, j)</div>
                <div>    END A;</div>
                <div><br>
                </div>
                <div>PROCEDURE C*;</div>
                <div>    BEGIN </div>
                <div>        A; </div>
                <div>        i := 2*j; </div>
                <div>        Out.Int(i, 5);  Out.Int(j, 5);  Out.Ln</div>
                <div>    END C;</div>
                <div><br>
                </div>
                <div>BEGIN</div>
                <div>END M.C</div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>Anyone can choose his or her favourite
                  indentation style.</div>
                <div><br>
                </div>
                <div>I personally don't like the two extremes
                  (Daniel and Knuth / Campbell). Imho they don't follow
                  Einstein's criterium "Make it as simple as ...":
                  Daniel's is too simplistic and Knuth's / Campbell's
                  are too convoluted.</div>
                <div><br>
                </div>
                <div>The classic Wirth / Gutknecht style is the
                  only style that is completely consistent: every scope
                  has its own indentation.</div>
                <div>BlackBox uses this style as standard.
                  See: <a href="https://hansklav.home.xs4all.nl/ProgrammingConventionsBB.pdf" target="_blank">https://hansklav.home.<wbr>xs4all.nl/<wbr>ProgrammingConventionsBB.pdf</a></div>
                <div><br>
                </div>
                <div>Some might find the Reiser / Mössenböck
                  styles more aesthetically pleasing because of their
                  simplicity. Although these styles are not as
                  consistent as the Wirth / Gutknecht style, in practice
                  this doesn't matter much because there is only one
                  module scope per compilation unit, and nested
                  procedures are rarely used in Oberon programs.</div>
                <div><br>
                </div>
                <div>The latter styles are used in two
                  excellent books: <i>The Oberon System</i> by
                  Martin Reiser and <i>Object-Oriented
                    Programming in Oberon-2</i> by Hanspeter Mössenböck.
                  These books are the two best typeset Oberon books
                  there are (imho). Unfortunately both have long been
                  out of print. A scanned copy of <i>The Oberon
                    System</i> can be found on the internet here: <a href="http://oberoncore.ru/library/reiser_the_oberon_system_user_guide_and_programmers_manual" target="_blank">http://oberoncore.ru/<wbr>library/reiser_the_oberon_<wbr>system_user_guide_and_<wbr>programmers_manual</a> ,
                  and there's a pdf-version of <i>OOP in
                    Oberon-2</i> here: <a href="http://ssw.jku.at/Research/Books/Oberon2.pdf" target="_blank">http://ssw.jku.<wbr>at/Research/Books/Oberon2.pdf</a> <wbr>.
                  In this pdf the source code indentation is not
                  rendered entirely accurately, so also have look at a
                  scanned version of this book: <a href="https://books.google.nl/books?id=BseoCAAAQBAJ&printsec=frontcover&dq=object+oriented+programming+in+oberon-2&hl=nl&sa=X&redir_esc=y#v=onepage&q=object%20oriented%20programming%20in%20oberon-2&f=false" target="_blank">https://books.google.nl/<wbr>books?id=BseoCAAAQBAJ&<wbr>printsec=frontcover&dq=object+<wbr>oriented+programming+in+<wbr>oberon-2&hl=nl&sa=X&redir_esc=<wbr>y#v=onepage&q=object%<wbr>20oriented%20programming%20in%<wbr>20oberon-2&f=false</a></div>
                <div><br>
                </div>
                <div>--</div>
                <div>Hans Klaver</div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
              </div>
              <div><br>
              </div>
            </div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="m_9183498231220295030mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><span class=""><pre>--
<a class="m_9183498231220295030moz-txt-link-abbreviated" href="mailto:Oberon@lists.inf.ethz.ch" target="_blank">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems
<a class="m_9183498231220295030moz-txt-link-freetext" href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank">https://lists.inf.ethz.ch/<wbr>mailman/listinfo/oberon</a>
</pre>
    </span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <p><br>
    </p>
    <pre class="m_9183498231220295030moz-signature" cols="72">-- 
______________________________<wbr>______
Dr. Dieter Glötzel
Im Rosengarten 27
64367 Mühltal
Tel.: 06151 / 360 82 72</pre>
  </font></span></div>

<br>--<br>
<a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" rel="noreferrer" target="_blank">https://lists.inf.ethz.ch/<wbr>mailman/listinfo/oberon</a><br>
<br></blockquote></div><br></div>