Pablo
Pablo

Reputation: 586

Ocaml: Unbound module Array

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

Answers (1)

Pierre G.
Pierre G.

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

Related Questions