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 operationOnArray arr ;
let l0 = [ 1 ; 2 ]
let l1 = operationOnList l0
let _ = assert (l0 = l1)
bGV0IG9wZXJhdGlvbk9uQXJyYXkgYXJyIDogdW5pdCA9CiAgbGV0IHRtcCA9IGFyci4oMCkgaW4KICBhcnIuKDApIDwtIGFyci4oMSkgOwogIGFyci4oMSkgPC0gdG1wCgpsZXQgb3BlcmF0aW9uT25MaXN0IGxhIDogJ2EgbGlzdCA9CiAgbGV0IGFyciA9IEFycmF5Lm9mX2xpc3QgbGEgaW4KICBvcGVyYXRpb25PbkFycmF5IGFyciA7CiAgQXJyYXkudG9fbGlzdCBhcnIKCgpsZXQgbDAgPSBbIDEgOyAyIF0KbGV0IGwxID0gb3BlcmF0aW9uT25MaXN0IGwwCmxldCBfID0gYXNzZXJ0IChsMCA9IGwxKQo=