fork download
  1. let keepSecondOne a b = b
  2.  
  3. let operationOnArray arr : unit =
  4. let tmp = arr.(0) in
  5. arr.(0) <- arr.(1) ;
  6. arr.(1) <- tmp
  7.  
  8. let operationOnList la : 'a list =
  9. let arr = Array.of_list la in
  10. keepSecondOne (operationOnArray arr) (Array.to_list arr)
  11.  
  12. let l0 = [ 1 ; 2 ]
  13. let l1 = operationOnList l0
  14. let _ = assert (l0 <> l1)
  15.  
Runtime error #stdin #stdout #stderr 0s 15904KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Fatal error: exception Assert_failure("prog.ml", 14, 8)