arrays - Ocaml implementation -
I got a little problem in implementing the array in Okay, for example, the terminal (console) / P>
let's tab = array Make 5 6; I have tab: int array = [| 6; 6; 6; 6; 6 |] As an output, it creates an array of 5 lengths and fills all cases with 6. Okay, I understand that part. But when I type it on a text editor like Kate, for example, save it and compile it I get this error:
Error: unbound value Array.make I do not understand why the arrays take in Kate as the value and take the array as a function in the terminal. I saved the file with the ".ml" extension and I compiled it using ocamlc -o test name_of_file . Any suggestions please? Thank you.
I compiled your program with ocamlc and it is fixed OCaml 3.12.0). I think that you are calling an older version of the compiler when you try to compile, probably since Array.make was still named < Code> Array.create . Perhaps when you install a new version, you overwrite some files (like upper part) but others (like compilers) do not. To check, compare the versions given by ocamlc -v and ocaml . As for the message "unbound value"? ??, in the Okmem, the function value is that there was no difference between the implementer an unwanted value which is not a function ??? And "unbound value" is a function, but this is not the cause of the problem. The reason for your problem is that Array.make is absolutely unbound.
Comments
Post a Comment