Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 797 days ago | link | parent

"I would argue that lisp's cond is ugly primarily because it puts conditions and actions on a single line."

I like single-line cases. I might argue 'cond is ugly because any language with 'cond is probably verbose enough to force the case and consequence onto separate lines. :-p (Clearly bullet could be an exception to that.)

What's especially ugly about 'cond is that, once the condition and consequence are on separate lines, there's an indentation issue. I don't like indenting by just one space or indenting past an already matched paren, so my code would look like this, probably unlike anyone else's code:

    ( (
    ( (
(Actually, my code would probably define a macro (ifs ...) that worked like Arc's 'if, but that's cheating.)

1 point by akkartik 797 days ago | link

"I like single-line cases. 'cond is ugly because.. the case and consequence onto separate lines."

You know, you're right. I change my mind. The major problem isn't merging lines, it is how to keep things clear when both the case and consequence are long. Just using indent to distinguish them is a poor solution because we use indent to group things together everywhere else.

To see how bad things can get, this definition of markdown is an eyesore: Wart doesn't really improve matters except to add the :else to distinguish the two consequences right at the end.