caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocaml+twt v0.90
@ 2007-01-16 20:48 Mike Lin
  2007-01-17  9:14 ` marshaling limits Sebastien Ferre
  2007-01-23 20:43 ` [Caml-list] ocaml+twt v0.90 Ingo Bormuth
  0 siblings, 2 replies; 14+ messages in thread
From: Mike Lin @ 2007-01-16 20:48 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

I just posted a new version of ocaml+twt, a preprocessor that lets you use
indentation to avoid multi-line parenthesization (like Python or Haskell).

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

This version introduces a major backwards-incompatible change: the
eradication of "in" from let expressions, and the need to indent the let
body (as suggested by the F# lightweight syntax). This reduces the
familiar phenomenon of long function bodies getting progressively more
indented as they go along. That is, before where you had:

let x = 5 in
  printf "%d\n" x
  let y = x+1 in
    printf  "%d\n" y

You'd now just write:

let x = 5
printf "%d\n" x
let y = x+1
printf "%d\n" y

I was hesitant to introduce this feature because it's extra hackish in
implementation (even moreso than the rest of this house of cards). It also
removes some programmer freedom, because you cannot have the let body on the
same line as the let, and you cannot have a statement sequentially following
the let, outside the scope of the binding. But after playing with it, I
think it is worthwhile. Please let me know what you think. I am still not
completely sure that I haven't broken something profound that will force me
to totally backtrack this change, but let's give it a try. I will obviously
keep the 0.8x versions around for those who prefer it and for existing code
(including a lot of my own).

Standard disclaimer: ocaml+twt is a flagrant, stupendous,
borderline-ridiculous hack, but it works quite well, I write all my new code
using it, and I recommend it if you like this style. On the other hand, if
someone with more free time and knowledge of camlp4 wants to step up, I have
a couple ideas about how you might do it right...

Mike

[-- Attachment #2: Type: text/html, Size: 2300 bytes --]

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

end of thread, other threads:[~2007-01-24 16:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 20:48 ocaml+twt v0.90 Mike Lin
2007-01-17  9:14 ` marshaling limits Sebastien Ferre
2007-01-17  9:36   ` [Caml-list] " Olivier Andrieu
2007-01-17 15:33   ` Frédéric Gava
2007-01-17 15:41     ` Sebastien Ferre
2007-01-17 16:12       ` Daniel Bünzli
2007-01-17 16:32         ` Olivier Andrieu
2007-01-18  8:14           ` Sebastien Ferre
2007-01-17 16:34         ` Sebastien Ferre
2007-01-17 19:37           ` Jonathan Roewen
2007-01-17 19:50           ` Yaron Minsky
2007-01-17 22:51             ` Markus Mottl
2007-01-23 20:43 ` [Caml-list] ocaml+twt v0.90 Ingo Bormuth
     [not found]   ` <2a1a1a0c0701231322h48e3af00m9f07371f236fe7c@mail.gmail.com>
2007-01-24 16:09     ` Ingo Bormuth

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).