Version française
Home     About     Download     Resources     Contact us    
Browse thread
ANN: "The Whitespace Thing" for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mike Lin <mikelin@m...>
Subject: Re: [Caml-list] ANN: "The Whitespace Thing" for OCaml
> I'm especially impressed by the removal of the sequence operator, and
> how you also use whitespace for multiple-lines applications.
> Is it really not ambiguous ?

Yes...the preprocessor uses rules such as: if an indented block
follows a let, if, try, etc., it's a sequence -- if it follows an
indentifier, then it's an application. This is sound, as far as I can
tell. There is a restriction that a multi-line expression has to start
on its own line, which lets me get away without actually building a
full AST for the source. Ideally that's how it would eventually work,
but...80/20.

Mike