[plt-scheme] Parentheses and color

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Jul 5 11:08:29 EDT 2007

On Jul  5, Dave Gurnell wrote:
> [...]
>      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).

I think that the nesting is still too deep on average to make colors
useful.  But speaking of this, an idea I partially implemented once
for Emacs (and for Nuprl, FWIW) is to highlight expressions according
to their quotedness.  The result *extremely* useful for writing
macros.  For example, see http://tmp.barzilay.org/x.png (this is for a
system where ","s that are not in a "`" mark meta-code).

It's probably even more relevant in PLT, where there are many ways to
switch to the meta-level and a visual color for that will make it
clear what code you're currently writing.  Even simple stuff like
making it obvious that your red-background macro-code cannot use
(lib "list.ss") bindings from a black `require' form.  Perhaps even
making it clear when you need to use `require-for-template'?

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.