Hey, I am new to this site. I need some help debugging some OCaml code. This is a simple Eratosthenes' prime sieve algorithm. I can do this easily in C, C++, C#, Java, MATLAB, Ruby, and Python, but as I am learning OCaml as my first functional programming language I can't get this to compile. I would really appreciate your help with this as a friend of mine recommended this site for teen programmers. Thanks again. Keep in mind that I am trying to keep this recursive. let max = 1000 in
let primes = Array.create 1000 true in
let num = 2 in
let outer_func num =
if num == sqrt.max then num
else if primes.(num) == true then
let pos = num * num in
let inner_func pos =
if pos > max then pos
else (
primes.(pos)<-false;);
inner_func (pos + num);
outer_func (num + 1);
for counter = 2 to max do
if primes.(counter) == true then
print_line counter;
done;;