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