caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: OCaml Mailing list <caml-list@inria.fr>
Subject: Re: [Caml-list] Question
Date: Wed, 3 Dec 2003 15:02:02 +0100	[thread overview]
Message-ID: <44F3B4CD-2599-11D8-A285-00039310CAE8@inria.fr> (raw)
In-Reply-To: <3FCB610E.932B363B@tni.fr>

On Monday, December 1, 2003, at 04:41 PM, sebastien FURIC wrote:

> # let test t t' = match t, t' with
>   | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0
> -> "OK"
>   | _ -> "KO";;
> Characters 73-79:
> Warning: this pattern is unused.
>   | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0
> -> "OK"
>                                           ^^^^^^
[...]

>  I was expecting "when" to be right distributive over "|".

That notion doesn't make sense because "when" is not a pattern operator.
If you "distribute" when over |, you get this:

  # let test t t' = match t, t' with
    | ((Toto _ | Titi _), Toto x when x = 0
       | Toto x, (Toto _ | Titi _) when x = 0)
      -> "OK"
    | _ -> "KO";;

which is nonsense, from O'Caml's point of view.

-- Damien

-------------------
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:[~2003-12-03 14:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-01 15:41 sebastien FURIC
2003-12-01 17:48 ` Remi Vanicat
2003-12-01 18:04   ` sebastien FURIC
2003-12-03 14:02 ` Damien Doligez [this message]
2003-12-10 10:27 ` Pierre Weis
2003-12-10 15:53   ` skaller
2003-12-11  9:52     ` Luc Maranget
2003-12-11 14:20       ` skaller
2003-12-11 16:56         ` Luc Maranget
2005-05-23  6:54 Question  dsingh01
2005-05-23  7:40 ` [Caml-list] Question Remi Vanicat
2005-05-23 12:21 ` Jacques Carette
2005-06-08 10:06 question  dsingh01
2005-06-08 15:13 ` [Caml-list] question Damien Bobillot

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=44F3B4CD-2599-11D8-A285-00039310CAE8@inria.fr \
    --to=damien.doligez@inria.fr \
    --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).