caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lauri Alanko <la@iki.fi>
To: caml-list@inria.fr
Subject: Re: [Caml-list] syntax foo
Date: Wed, 6 Feb 2002 21:58:07 +0200	[thread overview]
Message-ID: <20020206215807.A18430@kruuna.Helsinki.FI> (raw)
In-Reply-To: <20020206182555.GA32204@fichte.ai.univie.ac.at>; from markus@oefai.at on Wed, Feb 06, 2002 at 07:25:55PM +0100

On Wed, Feb 06, 2002 at 07:25:55PM +0100, Markus Mottl wrote:
> On Wed, 06 Feb 2002, Brian Rogoff wrote:
> > The syntactic differences between Haskell and OCaml are insignificant
> > beside the semantic ones.
> 
> This is definitely not true: Haskell is sensitive to layout, which alone
> makes it very different from a syntactic point of view. Though this
> lets Haskell-programs look very nice to the human eye, it also makes
> other things more difficult, e.g. using preprocessors or automatic code
> generation. The parser is also more difficult to implement.

Note that the layout rule in Haskell is _optional_. You can always use
explicit braces and semicolons and forget about indentation. So at least
your point on code generation doesn't hold.

Personally, I find Haskell's syntax (with or without the layout rule)
infinitely more convenient than OCaml's. Anything that uses "end" to mark
the end of a block is hopelessly clumsy and old-fashioned. :)

The sorest lack in both the old and the revised syntax is the need for a
let*-form, ie. a sequence of bindings, each of which is in the scope of the
previous ones. I _so_ hate doing this:

let foo = bar in
  let baz = quux in
    let fnord = fnarp in
      ...
      
Here foo occurs free in quux and baz occurs free in fnarp. So I have to
write "in let" between every binding, which is annoying, as is also the
nesting. I would prefer something like this:

let* foo = bar;
     baz = quux;
     fnord = fnarp; 
in
     ...
     
(Possibly even without the "in", it is also ugly.)

That should be enough whining for now. Thankfully, camlp4 allows everyone to
fix these issues according to their own preferences.


Lauri Alanko
la@iki.fi
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2002-02-06 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 20:48 james woodyatt
2002-02-05 21:21 ` Jérôme Marant
2002-02-06 15:30   ` Brian Rogoff
2002-02-06 18:25     ` Markus Mottl
2002-02-06 19:58       ` Lauri Alanko [this message]
2002-02-06 20:41         ` Markus Mottl
2002-02-06 20:47           ` Alexander V. Voinov
2002-02-07  1:43       ` Brian Rogoff
2002-02-06 19:08     ` Alexander V. Voinov
2002-02-06 19:10     ` David Brown

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=20020206215807.A18430@kruuna.Helsinki.FI \
    --to=la@iki.fi \
    --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).