Browse thread
Fragile pattern matching?!
- Alex Baretta
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-02-28 (10:17) |
From: | Alex Baretta <alex@b...> |
Subject: | Fragile pattern matching?! |
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/>