[plt-scheme] Scheme contradictions

From: Vladimir Zlatanov (vlado at dikini.net)
Date: Thu May 4 09:27:57 EDT 2006

The funniest bit of all is that scheme and/or lisp have one of the
cleanest syntax conventions of them all. And probably that is the 
biggest downside. In most of the mentioned languages like Python, Ruby,
Perl, C, php, plug your own, the weirdness in syntax is helping the
immediate visual recognition of what is going on. In scheme the visual
overview of a piece of code gets you only to a certain point, then you
need to start counting parenthesis, or at least the instinct tells you
so.

I'm a scheme novice, but I have some experience in programming, so
these are my own impressions. I do like the clean syntax, but it really
gets to me, when I need do go down dirty and count, simply because I
made a typo. The [] addition helps with visual qeues. But is it enough?

Maybe it can be a good thing to add python/ruby/haskell like layout
syntax. I know there were experiments flying around. Recently Peter
Schombert wrote an anlysis in his blog about it:
   http://pschombe.wordpress.com/2006/04/16/lisp-without-parentheses
I think it is a good idea, at least for people with experience in other
languages, to come to the lisp family. It is kind of syntactic sugar,
which can increase the readability of a program.

I wouldn't mind having a go at this, the algorithm is nothing special,
just keep track of the context in a stack, there are one or two gotchas
more that in Peter's blog post, but still it shouldn't be hard. I just
wouldn't like doing a work already done - as far as I understand the
mzscheme reader already does indent tracking. It is used for error
reports and in the DrScheme indentation code. 

How complicated, and more importantly, where should I begin looking, if
I want to introduce something similar to #cs , let's say #ls for layout
sensitive? Can I do this by modifying the read tables, or I need to go
the full monty and implement a new lexer (I hope not)?

Vlado



Posted on the users mailing list.