On Sun, 19 Nov 2006, drehman27 wrote:
> Hi,
> When I compile the following code I get a warning message that I don't
> understand. What is wrong?
> Warning U: this match case is unused.
The message refers to this part:
> match h with
> (uid, rat) ->
> output_binary_int movies_data (pack_user_rating uid rat);
> write_user_ratings t movies_data
> | _ -> failwith "There is a mistake in the movies ratings!"
(uid, rat) is a pattern that will catch everything. This is why the
compiler warns you that the _ branch will never be reached.
That's because h is a pair and can't be anything else at the same time.
Since uid and rat are just names, (uid, rat) or (_, _) or _ are
equivalent here.
Martin
--
Martin Jambon, PhD
http://martin.jambon.free.fr
Ce message est confidentiel. Merci !
This message is confidential. Thanks!
.