List Info

Thread: Re: "ocaml_beginners"::[] Re: Can't verify object data ?




Re: "ocaml_beginners"::[] Re: Can't verify object data ?
country flaguser name
United Kingdom
2007-09-05 05:07:05


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

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Need traffic?

Drive customers

With search ads

on Yahoo!

Yoga Groups

Exchange insights

with members of

the yoga community.

"ocaml_beginners"::[] Re: Can't verify object data ?
country flaguser name
United States
2007-09-05 05:54:18

Ok, fine I got it ;)

--- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, Vincent Aravantinos
<vincent.aravantinos...> wrote:
&gt;
>
> 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.
&gt;
> 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
>;

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yoga Groups

Exchange insights

with members of

the yoga community.

[1-2]

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