diff options
| author | chrismamo1 <christophermcalpine@gmail.com> | 2015-09-09 12:42:19 -0600 |
|---|---|---|
| committer | Damien Doligez <damien.doligez@inria.fr> | 2016-02-10 14:50:05 +0100 |
| commit | 7cf3966419076e1cffd30991fac5d1d4458c3dca (patch) | |
| tree | 6882db51379e061868e0f4d2b79a1109c5f42575 /stdlib/array.ml | |
| parent | 34380c878242f7192b822d9699d88d4bde991080 (diff) | |
| download | ocaml-7cf3966419076e1cffd30991fac5d1d4458c3dca.tar.gz | |
fixed exception handling in array.ml to conform to conventions
Diffstat (limited to 'stdlib/array.ml')
| -rw-r--r-- | stdlib/array.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/array.ml b/stdlib/array.ml index f958f220b1..dcea4d0573 100644 --- a/stdlib/array.ml +++ b/stdlib/array.ml @@ -78,7 +78,7 @@ let iter f a = for i = 0 to length a - 1 do f(unsafe_get a i) done let iter2 f a b = - if length a <> length b then raise (Invalid_argument "arrays must have the same length") + if length a <> length b then invalid_arg "Array.iter2: arrays must have the same length" else for i = 0 to length a - 1 do f (unsafe_get a i) (unsafe_get b i) done @@ -95,7 +95,7 @@ let map f a = let map2 f a b = let la = length a in let lb = length b in - if la <> lb then raise (Invalid_argument "arrays must have the same length") else begin + if la <> lb then invalid_arg "Array.map2: arrays must have the same length" else begin if la = 0 then [||] else begin let r = create la (f (unsafe_get a 0) (unsafe_get b 0)) in for i = 1 to la - 1 do |
