Reputation: 586
Why doesn't work?
let data = [| 1; 2; 3; 4; |] in
let len = Array.length data in
for i = 0 to len do
Printf.printf "%d\n" i
done
ocamlc array.ml -c array.byte Displays an error is Unbound module Array
Upvotes: 2
Views: 249
Reputation: 4441
This might come from the name of your source code : array.ml which collapse with the name of the module you wish to use.
Just change the name of your file to sth else, and you should compile succesfully.
Upvotes: 3