[plt-scheme] Parentheses and color

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Thu Jul 5 07:42:44 EDT 2007

I have an alternative proposal (well, two actually):

I would find this feature most useful when searching for mismatched  
parentheses at the request of the compiler. With this in mind, this  
feature could be one that can be turned on/off like check syntax (so  
we get around the visual crowding issue).

IMO, highlighting the *parentheses* is only marginally useful:  
they're too small for the colouring to stand out. once you've found,  
say, the cyan opening bracket, it can take a while to scan through  
and find the closing bracket of the same colour. DrScheme's grey  
highlight feature is much faster for this kind of thing. In other  
words, don't colour the parentheses: colour the forms themselves.

Has anyone ever seen the Firefox "Web Developer Toolbar" addon? The  
"Display Topographic Information" feature (in the "Information" menu)  
colours the current page according to the block structure of its  
elements. Take this Google results page as an example:

     http://www.davegurnell.com/files/no_topographic_information.png
     http://www.davegurnell.com/files/topographic_information.png

While the colouring leaves a little to be desired, the version with  
topographic information clearly shows all the DIVs and table cells.  
The feature is only marginally useful when debugging HTML, but I  
reckon it could be really useful for finding mismatched/misplaced  
parentheses in s-expressions (including quoted expressions where  
indentation is not always obvious).

And here's another idea:

Correct/automatic indentation helps identify a lot of structural  
mistakes in s-expressions, but if the expression is large and  
complicated, it's not always obvious which column a line starts in.  
Perhaps one could colour DrScheme's background in the manner of line  
printer output. I've put an (IMHO) aesthetically pleasing example here:

     http://www.davegurnell.com/files/ 
drscheme_with_column_highlighting.psd

I've seen this in editors in the past and I never found it  
particularly useful then, but I wasn't programming Scheme back then.  
Another option is highlighting the column that contains the cursor (I  
think TextMate does this but don't quote me on it).

Anyway - these are just thoughts. Hopefully I haven't suggested  
features that I've never noticed, that are already available in  
DrScheme (though I did check just in case).

Cheers,

-- Dave


Posted on the users mailing list.