English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
partial match in let
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-11-29 (18:40)
From: Dan Grossman <djg@c...>
Subject: Re: [Caml-list] partial match in let

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)