let keepSecondOne a b = b
let operationOnArray arr
: unit = let tmp = arr.(0) in
arr.(0) <- arr.(1) ;
arr.(1) <- tmp
let operationOnList la
: 'a
list = let arr
= Array.of_list la
in keepSecondOne
(operationOnArray arr
) (Array.to_list arr
)
let l0 = [ 1 ; 2 ]
let l1 = operationOnList l0
let _ = assert (l0 <> l1)
bGV0IGtlZXBTZWNvbmRPbmUgYSBiID0gYgogIApsZXQgb3BlcmF0aW9uT25BcnJheSBhcnIgOiB1bml0ID0KICBsZXQgdG1wID0gYXJyLigwKSBpbgogIGFyci4oMCkgPC0gYXJyLigxKSA7CiAgYXJyLigxKSA8LSB0bXAKCmxldCBvcGVyYXRpb25Pbkxpc3QgbGEgOiAnYSBsaXN0ID0KICBsZXQgYXJyID0gQXJyYXkub2ZfbGlzdCBsYSBpbgogIGtlZXBTZWNvbmRPbmUgKG9wZXJhdGlvbk9uQXJyYXkgYXJyKSAoQXJyYXkudG9fbGlzdCBhcnIpCgpsZXQgbDAgPSBbIDEgOyAyIF0KbGV0IGwxID0gb3BlcmF0aW9uT25MaXN0IGwwCmxldCBfID0gYXNzZXJ0IChsMCA8PiBsMSkK