caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ANN: "The Whitespace Thing" for OCaml
@ 2005-11-21 22:40 Mike Lin
  2005-11-22  7:25 ` [Caml-list] " David Baelde
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Lin @ 2005-11-21 22:40 UTC (permalink / raw)
  To: caml-list

Hi all,

Brace yourselves for "The Whitespace Thing". This is an OCaml
preprocessor that uses your indentation to group expressions, like in
Python and Haskell. Effectively, the preprocessor auto-parenthesizes
expressions that are split over multiple lines, using your indentation
as clues. This eliminates syntax clutter such as multi-line
parenthesizations, the sequencing operators ; and ;; , and the
keywords done, end, and begin.

http://people.csail.mit.edu/mikelin/ocaml+twt/

Mike


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ANN: "The Whitespace Thing" for OCaml
  2005-11-21 22:40 ANN: "The Whitespace Thing" for OCaml Mike Lin
@ 2005-11-22  7:25 ` David Baelde
  2005-11-22 16:23   ` Mike Lin
  0 siblings, 1 reply; 3+ messages in thread
From: David Baelde @ 2005-11-22  7:25 UTC (permalink / raw)
  To: caml-list

Nice job!

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 ?

Thanks.
--
David


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ANN: "The Whitespace Thing" for OCaml
  2005-11-22  7:25 ` [Caml-list] " David Baelde
@ 2005-11-22 16:23   ` Mike Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Lin @ 2005-11-22 16:23 UTC (permalink / raw)
  To: caml-list

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-22 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 22:40 ANN: "The Whitespace Thing" for OCaml Mike Lin
2005-11-22  7:25 ` [Caml-list] " David Baelde
2005-11-22 16:23   ` Mike Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).