Ok, fine I got it ;)
--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, Vincent Aravantinos
<vincent.aravantinos
...> wrote:
>
>
> Le 5 sept. 07 à 11:43, bobshibby36 a écrit :
>
> > OK I found out the way of doing this
> >
> > if links_sort_fun==sort_by_count ...
> >
> > It's works. But why my match did not work too?
> >
> >> match links_sort_fun with
> >> sort_by_count -> ....
> >> | sort_by_feature ->....
>
> -> this is almost the same as :
>
> match links_sort_fun with
> x -> ...
> | y -> ...
>
> (except you should substitute references to sort_by_count/
> sort_by_feature with x/y)
>
> or :
> match links_sort_fun with
> _ -> ...
> | _ -> ...
>
> see the semantics ? the two branches catch any case.
>
> ie when put in the left member of a case, a variable is considered as
> a new variable (the compiler forget its previous meaning).
>
> This is a frequent beginner error and someone explained it very well
> and concisely recently in this thread but I can't find it (think it
> was William Neuman).
>
> Hope it's clear...
>
> --
> Vincent Aravantinos
> PhD Student - LIG - CAPP Team
>