<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 4 June 2015 at 17:30, Sam Watkins <span dir="ltr"><<a href="mailto:sam@nipl.net" target="_blank">sam@nipl.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":14h" class="" style="overflow:hidden">For more readable LISP, I figure we need implicit parens around lines,<br>
and encompassing any indented block argument:<br>
<br>
    define<br>
        largest-two-square-sum x y z<br>
        if (= x (larger x y))<br>
            sum-of-squares x (larger y z)<br>
            sum-of-squares y (larger x z)<br>
<br>
Is more readable to me than:<br>
<br>
    (define<br>
        (largest-two-square-sum x y z)<br>
            (if (= x (larger x y))<br>
                (sum-of-squares x (larger y z))<br>
                (sum-of-squares y (larger x z))<br>
            )<br>
    )</div></blockquote></div><br><div class="gmail_default" style="font-family:monospace,monospace">​They look about the same to me, Sam. Perhaps throw a few list comprehensions in there for fairness ;-)<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">You should really be laying out your list like so:<br><br>​(define (largest-two-square-sum x y z) (if (= x (larger x y)) (sum-of-squares x (larger y z)) (sum-of-squares y (larger x z)) ))<br>(define (larger x y) (if (> x y) x y))<br>(define (sum-of-squares x y) (+ (square x) (square y)))<br>(define (square x) (* x x) )<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">Jokes aside, the above looks like a bunch of equations from high school algebra.  You can model the execution of the code with a process of recursively evaluating the inner most scopes and substituting the results.  You get a sense that the code executes by continually collapsing in on itself, becoming progressively more simple. Its kinda Zen. That model works really well with the Virtual Machine that I'm continually running in my head while I cut code. I find it quite meditative and satisfying.<br></div><br clear="all"><div><div class="gmail_signature"></div></div>
</div></div>