On 5/18/07, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
> Hi,
>
> In message "Re: Why not adopt "Python Style" indentation for Ruby?"
>     on Fri, 18 May 2007 22:01:13 +0900, Daniel Martin <martin / snowplow.org> writes:
>
> |Note that the Haskell folks have managed to evolve a language in which
> |python-like spacing can be used to mark the extent of discrete code
> |chunks, but so can traditional braces.
>
> I admit Haskell syntax is much better than Python's.  But I am not yet
> sure if it can be applied to Ruby.
>
>                                                         matz.

I've picked up on python in the last couple months and like the
indentation.   In addition to forced readablity, I find another
practical benefit is that it eliminates hard to track down syntax
errors due to matching {}, begin/end, etc.  In ruby, C, perl, etc
these errors can be painful to track down in a large file with lots of
blocks within blocks.

Syntactically it isn't too difficult once you have the lexer generate
indent and unindent tokens.  Then the parser just looks for matching
indent and unindent tokens instead of {} or begin/end, etc.

You might consider something like this as an alternative block syntax.
 Maybe a ":" followed by a newline (and extra indentation) would start
this style.  I'm not sure of a clean way to handle arguments though.

p.s. in the late eighties I made a little shell language (for the
Atari ST) that used indentation just like python.