hjskeqwe
hjskeqwe

Reputation: 175

OCaml -- how to check if two lists match

Say I have two lists:

let l1 = [1;2;3];;
let l2 = [1;2;3];;

I am trying to check if they have the same values and order, but if I do

l1 == l2;;

I get false. How do I check if they have the same values in the same order?

Upvotes: 2

Views: 4646

Answers (1)

hjskeqwe
hjskeqwe

Reputation: 175

Never mind. I forgot that = was different in OCaml.

list1 = list2

returns true...

Upvotes: 8

Related Questions