caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Mike Lin" <mikelin@mit.edu>
To: caml-list@inria.fr
Subject: ocaml+twt v0.90
Date: Tue, 16 Jan 2007 15:48:52 -0500	[thread overview]
Message-ID: <2a1a1a0c0701161248l5a1d9ad9q739da9c593fc5219@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2007-01-16 20:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 20:48 Mike Lin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a1a1a0c0701161248l5a1d9ad9q739da9c593fc5219@mail.gmail.com \
    --to=mikelin@mit.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).