caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: Edgar Friendly <thelema314@gmail.com>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] "Warning U: this match case is unused." -- Yes, I know
Date: Wed, 27 Feb 2008 23:21:37 +0100	[thread overview]
Message-ID: <1204150897.7005.44.camel@Blefuscu> (raw)
In-Reply-To: <47C5DF7C.4010107@gmail.com>

On Wed, 2008-02-27 at 16:09 -0600, Edgar Friendly wrote:
> > 1. I can wrap the user's pattern-matching inside a try...with, catch any
> > Match_failure and deal with it. 
> This seems hackish.

Indeed. I'm not planning to carry on that threat :)

> It may seem that you've taken care of all cases, but keep in mind that
> the compiler looks at a match case containing a 'when' clause and
> assumes that clause can cause the match to fail, independent of all
> other terms.

Let me rephrase.

In my extension, the user can decide of *any* pattern. The main
difference with usual OCaml-style pattern-matching is that the
equivalent of Match_failure is not a fatal error. Think Erlang-style
mailbox-checking or ML-style exception catching: if there's no
interesting message waiting or if we're installing an exception handler
for another exception than what has been raised, well, it's probably not
an error. 

So I need to be able to specify what happens in case of match failure.
Doing that is a one-liner, I can just add 
  | _ -> foobar
after my last match case. Now, I just want to get rid of Warning U.

Cheers,
 David


-- 
David Teller
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations. 


  reply	other threads:[~2008-02-27 22:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 21:32 David Teller
2008-02-27 21:48 ` [Caml-list] " Till Varoquaux
2008-02-27 21:56   ` David Teller
2008-02-27 22:09 ` Edgar Friendly
2008-02-27 22:21   ` David Teller [this message]
2008-02-27 22:30     ` Edgar Friendly

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=1204150897.7005.44.camel@Blefuscu \
    --to=david.teller@univ-orleans.fr \
    --cc=caml-list@inria.fr \
    --cc=thelema314@gmail.com \
    /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).