Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 4324 days ago | link | parent

Thanks for those examples! Yes, I didn't want to hardcode ':' for just this one cond use case I had in mind. I wanted to let people highlight the tests rather than the branches if they preferred.

One nit: I wish the first two gave branches more indent than tests; I think I'm comparing them to switch statements.

In this fragment from example 1:

    (let dummy 34
      (submit-page user url title showtext text bothblank*))
      : (let site sitename.url
          (or big-spamsites*.site recent-spam.site))
..and in this one from example 2:

    (let dummy 34
      (submit-page user url title showtext text bothblank*))
  :   (let site sitename.url
        (or big-spamsites*.site recent-spam.site))
..the colon isn't separating the cases clearly enough IMO. There's a confounding vertical alignment that distracts the eye.

The discussion on readable-discuss suggested example 2, but it would require editor support to ensure indenting a line doesn't move the ':' at the start. Autoindent settings would also interfere. But they're like #ifdef's, so there's some precedent for doing things this way. Keeping the ':' in column 1 would eliminate the need for clarifying that the colon "does affect the indentation of a line.." That might make them more intuitive.

I hadn't considered the latter two ideas; they are very compelling indeed. I'm going to think about them more.

Ah, I didn't realize you disabled indent-sensitivity inside of parens, so I thought that example's indentation might have been important."

Actually even that is irrelevant ^_^. Even before I disabled indent inside parens those examples wouldn't insert parens anywhere because the inner clauses are all fully parenthesized. Wart has never wrapped a line in parens if it already began with parens.

Basically paren insertion is extremely conservative and avoids messing with code as much as possible. Now that I've disabled it inside parens this is even more true.