what is the difference here ?

"Roelof Wobben [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
Hello,

I found the solution to exercise 2 of the 99 ocaml problems.
The solution I found was this :

let rec last_two list =
    match list with
      | [] | [_] -> None
      | [x;y] -> Some (x,y)
      | _::xs -> last_two xs ;;


Now I wonder something.
For me it looks like [x;y]  and _::xs are the same.
If I understand it right you can write [x;y] as x::y and _::xs looks 
then the same to me.
But if I change [x;y] to x::y then I see a message that _:xs is not used.

Can someone explain in simple words what is the difference between those 
two ?

Roelof
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.