Hacker News new | past | comments | ask | show | jobs | submit
This post misses the IMO best indentation scheme for lisp, which I used for my college class where we had to use MIT scheme:

    (define (match:element variable restrictions)
        (define (ok? datum)
            (every 
                (lambda (restriction)
                    (restriction datum)
                )
                restrictions
            )
        )
        (define (element-match data dictionary succeed)
            (and 
                (ok? data)
                (let ((vcell (match:lookup variable dictionary)))
                    (if vcell
                        (and 
                            (equal? (match:value vcell) data)
                            (succeed dictionary)
                        )
                        (succeed (match:bind variable data dictionary))
                    )
                )
            )
        )
        element-match
    )
It may not be densest or most compact indentation scheme, but damn is it readable for someone without a lisp/scheme background!
loading story #42764619
loading story #42765491
loading story #42765510
loading story #42764362
That is blasphemy.
You may not like it, but this is what peak lisp indentation looks like :)

Honestly though, this style for ending parenthesis of block-type nodes makes a lot of sense to me. And you still retain the benefit of macro-ing your own syntax when you need it.

The uncuddled closing parens are a sure sign of a sick mind; probably corrupted by C or the like.
loading story #42765096
loading story #42766349
loading story #42769578
One thing I dislike about the compact style is how adding/removing a let block causes a diff line that is just adding/removing a parent.
loading story #42765409
A blasphemy is a very useful thing in cases when a discipline turns into a religion. (Yes, I know about jokes.)
Nicely indented easy to read blasphemy is the most dangerous kind!
Exactly what I was thinking.
I’ve been in too many arguments about Lisp indentation but that actually comes close to decent with a couple of changes: move the singleton closing parens up, and reduce to, say, 2 spaces.
loading story #42766238
loading story #42768369
loading story #42763762
loading story #42767190
loading story #42765360
loading story #42766269
loading story #42765623
loading story #42765868
loading story #42765422
Haha, good one!

(I hope?!)

loading story #42766340
loading story #42764530