[racket] syntax, differently

From: hendrik at topoi.pooq.com (hendrik at topoi.pooq.com)
Date: Sat Jul 31 16:04:44 EDT 2010

On Sat, Jul 31, 2010 at 09:42:06PM +0200, Jos Koot wrote:
> I am not a student, but try to think and do like student now.
> 
> I would be very frustrated when all the time I run a program, my code would
> be reindented and get quite another appearance. WHAT HAPPENS HERE, would be
> my first thought. Reindenting a file before saving it would give me the same
> surprise when opening it again. Wow, this apparently is not the program I
> have entered. Where is my program???
> 
> Nevertheless I agree with Matthias that indentation is a very helpfull tool.
> But doing that without explicit request seems confusing to me (at the least)
> 
> Just a strong advice to type control-I from time to time would not be
> adaquate? Furthermore, typing a program with the standard indentation
> settings already gives indentation while typing. Wow, that's not the
> indentation I expected after my last line-break. Ho, I see, a parenthesis
> too much or too less in the previous line. No problem, add or remove it
> followed by control-I.
> 
> BTW, for myself I prefer indentation by exactly as many spaces as there are
> unsatisfied open parentheses (for as far as possible, for shotcuts like '''
> and '#'' and '#,@' may inhibit my preferred indentation.)

It would suffice to change the colour of a parenthesis whenever 
its mate is not at a compatible level of indentation.

Let the programmer decide what has to be done to fix this.  He can 
indicate this by continuing to edit.  He may well let coloured 
parentheses accumulate until he's ready to deal with them.

Don't go reindenting the entire file without explicit request.  Whenever 
something happens to me like that, I am lost in the code.  Usually the 
indentation is more correct than the parentheses, even when my editor 
provides no automatic support, and I use the indentation as a guide to 
find my way around, and to guide me when I insert parentheses.

-- hendrik



Posted on the users mailing list.