caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Harrison, John R" <johnh@ichips.intel.com>
To: "'Xavier Leroy'" <xavier.leroy@inria.fr>,
	Brian Rogoff <bpr@bpr.best.vwh.net>
Cc: caml-list@inria.fr
Subject: RE: [Caml-list] Caml historical question
Date: Tue, 15 Jan 2002 09:08:41 -0800	[thread overview]
Message-ID: <FD2423AA68A7D511A5A20002A50729E12C0FE8@orsmsx115.jf.intel.com> (raw)

Hi Xavier,

| What is deprecated in OCaml, but was supported in Caml Light and Caml
V3.1,
| is multiple-case "fun":
|         fun pat11 ... patN1 -> expr1
|           | ...
|           | pat1M ... patNM -> exprM
| Although this form subsumes the previous two, the extra generality was
| rarely useful, and complex patterns have to be parenthesized so that
| the parser can figure them out.

I used it quite a lot in CAML Light, and had to uglify my code to get
the same effect in OCaml. It seems to me that the extra generality does
no harm, and sometimes makes code a bit shorter and clearer.

I can understand the need for separate "fun" and "function" to deal with
ambiguities when multiple adjacent patterns are in a match. But I don't
see any reason at all to restrict "fun" to a single case. Surely there
are no substantial parsing subtleties here that don't arise anyway in
other cases? There are clear delimiters "|" and "->" around each
(multiple) pattern.

John.
-------------------
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-01-15 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-15 17:08 Harrison, John R [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-10 16:40 Brian Rogoff
2002-01-15 14:54 ` Xavier Leroy

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=FD2423AA68A7D511A5A20002A50729E12C0FE8@orsmsx115.jf.intel.com \
    --to=johnh@ichips.intel.com \
    --cc=bpr@bpr.best.vwh.net \
    --cc=caml-list@inria.fr \
    --cc=xavier.leroy@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).