[plt-scheme] Paren Paralysis Sufferers Unite

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Thu Oct 29 14:13:47 EDT 2009

Synx wrote:
> Really the only problem I have with parentheses is one of lexical
> context. I personally have a hard time maintaining a stack of context in
> my head, so when I reach a ) I can't easily tell what context I just
> returned to. Matching the closing parentheses /when I type it/ helps,
> but if I'm just looking at code that says
> 
> (if (test? a)
>   (if (test? b)
>     ((let ((c (+ a b)))
>        (lambda (d)
>          (+ c d)))
>     b))
> 
> I have no clue what that last 'b' is applied to. (it breaks down to (+ a
> b b), right?) So when I encounter ))))))))) (and I frequently do) I have
> to manually count the parentheses and track them back _with my finger_
> to find where to insert a new cond clause for instance. Even if I'm
> looking at my own code!
> 
> It's really frustrating. :(

DrScheme can highlight different parenthesized regions in different 
colors. Open the preferences dialog, go to the Colors tab, and switch 
the "Parenthesis color scheme" to anything other than "Basic grey". Then 
find some code and put the cursor right before or after a large, highly 
nested parethesized group.

I agree with John's points too, though. I usually find indentation 
sufficient.

Ryan



Posted on the users mailing list.