caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <pierre.weis@inria.fr>
To: kgergely@mlabdial.hit.bme.hu (Kontra, Gergely)
Cc: daniel.de_rauglaudre@inria.fr, caml-list@inria.fr
Subject: Re: [Caml-list] syntaxes
Date: Mon, 7 Oct 2002 09:06:18 +0200 (MET DST)	[thread overview]
Message-ID: <200210070706.JAA04709@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.21.0210041254140.7784-100000@mlabdial.hit.bme.hu> from "Kontra, Gergely" at "Oct 4, 102 12:58:00 pm"

> >> Sometimes SML solution is shorter.
> >For example?
> 
> pattern matching in function head...
> 
> Gergo
> +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
> |         Email: kgergely@mcl.hu,  kgergely@turul.eet.bme.hu          |
> |  URL:   turul.eet.bme.hu/~kgergely    Mobile: (+36 20) 356 9656     |
> +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+

This has been reported many times as such, but:

1) Semantically, this is not as clear as Caml's ``function'' construct.

2) You have to carefully count characters before stating that pattern
matching in function head is shorter! Very often, functions using
pattern matching have many cases, and repeating the function name for
each clause is a burden and a lot more typing.

3) We already had this feature in Caml in the past. When we suppressed
it, nobody complained at the time: I suspect that serious Caml's users
(those that write in the mailing lists to complain and ask for new
features) never used ``pattern matching in function head''.

In my mind ``pattern matching in function head'' is a typical
``programming in the small'' feature: it is useful for beginners
and/or small functions with only 2 or 3 cases but useless for huge
pattern matchings.

Once more Caml has a tendency to favour programming in the large.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2002-10-07  7:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04  7:40 Kontra, Gergely
2002-10-04  8:32 ` Daniel de Rauglaudre
2002-10-04 10:58   ` Kontra, Gergely
2002-10-04 11:04     ` Daniel de Rauglaudre
2002-10-07  7:06     ` Pierre Weis [this message]
2002-10-04  9:22 ` Pierre Weis

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=200210070706.JAA04709@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=daniel.de_rauglaudre@inria.fr \
    --cc=kgergely@mlabdial.hit.bme.hu \
    /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).