Arc Forumnew | comments | leaders | submitlogin
3 points by almkglor 6122 days ago | link | parent

Forms which have a condition-code form (if, case, p-m) should generally have the code indented more than the condition:

  (if
    (something-or-other foo bar)
        (do (this))
    (some-other-thing bar foo)
        (do (that)))


1 point by tel 6122 days ago | link

I know this has been pg's convention in the code, but in my code I've been keeping the indentation at the same level. Since code tends to shoot off toward the right, you get code that look like:

    (if
      (cond1 ...)
      (map some-fn (generation-fn arg arg arg
                                  (maybe-table key)))
      (cond2 arg (some-fn2 (...)
                           (...)))
      (some-fn3 arg arg))
It's pretty easy to count off condition/result pairs like this, but if you indent the results it gets more difficult to pick them out from the conditions.

-----