简体   繁体   中英

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?

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

list1 = list2

returns true...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM