caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Fragile pattern matching?!
@ 2005-02-28 10:17 Alex Baretta
  2005-02-28 10:32 ` [Caml-list] " Keith Wansbrough
  2005-02-28 10:39 ` Luc Maranget
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Baretta @ 2005-02-28 10:17 UTC (permalink / raw)
  To: Ocaml

We have an incomprehensibile warning when compiling code that looks like 
the following:

type value =
   | Int of int
   | Float of float
   | Int32 of int32
   | Int64 of int64
   | Bool of bool
   | String of string

let to_int value = match value with
   | Int x -> x
   | _ -> raise Some_exception

The compiler signals a warning for a fragile pattern matching at the "_" 
character.

Why in the world should this code signal such a warning?

Alex


-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-28 10:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-28 10:17 Fragile pattern matching?! Alex Baretta
2005-02-28 10:32 ` [Caml-list] " Keith Wansbrough
2005-02-28 10:35   ` Alex Baretta
2005-02-28 10:39 ` Luc Maranget
2005-02-28 10:49   ` Alex Baretta

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).