List Info

Thread: "ocaml_beginners"::[] warning message




"ocaml_beginners"::[] warning message
user name
2006-11-19 21:29:57

On Sun, Nov 19, 2006 at 09:01:14PM -0000, drehman27 wrote:
> Warning U: this match case is unused.
> 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!"

You didn't show us the full example, but we can assume that h is a
tuple of two somethings.

So the first match clause [(uid, rat) ->] matches 'h' every time, and
the second [_ ->] is unused.

The more common way to write this is:

let uid, rat = h in
output_binary_int [etc...]

Rich.

--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )