Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Dan Grossman <djg@cs.washington.edu>
To: Dan Grossman <djg@cs.washington.edu>
Cc: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>,
	caml-list@inria.fr
Subject: Re: [Caml-list] partial match in let
Date: Mon, 29 Nov 2004 10:45:33 -0800	[thread overview]
Message-ID: <41AB6E4D.9010701@cs.washington.edu> (raw)
In-Reply-To: <41AB6D0F.5010107@cs.washington.edu>


Oops, a bit too hasty on the send (flaky mail reader):

let (x,y) = (match f(x) with [x1;y1] -> (x,y) | _ -> assert false) in foo

Dan Grossman wrote:

> 
> let g x = match f(x) with [x1;y1] -> (x,y) | assert false
> let (x,y) = g x in foo
> 
> Christophe Raffalli wrote:
> 
>>
>> Wish: I had like a way to avoid the partial match warning in code like
>>
>> let [x;y] = f (x) in foo
>>
>> Because if foo is long writing
>>
>> match f(x) with [x;y] -> foo | _ -> assert false
>>
>> is really ennoying, especially if you have a long sequence of let.
>>
>> I find usefull the partial match warning for match and function but 
>> not for let (if you write a let, I think you are aware that your 
>> matching will be partial for any data type with more than one 
>> constructor, you do not need a warning)
>>
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


  reply	other threads:[~2004-11-29 18:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-29 17:10 Christophe Raffalli
2004-11-29 18:40 ` [Caml-list] " Dan Grossman
2004-11-29 18:45   ` Dan Grossman [this message]
2004-11-29 18:42 ` Dan Grossman
2004-11-29 19:02 ` Robert W.
2004-11-30 14:05 ` Luc Maranget

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=41AB6E4D.9010701@cs.washington.edu \
    --to=djg@cs.washington.edu \
    --cc=Christophe.Raffalli@univ-savoie.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