On 23 Dec 2003, at 11:00, Tyler Eaves wrote: > > I think I'm beginning to get it. Attached find my second try at a prime > number generator. > > This one is distinguished from my first by two important differences: > > 1: It is written (I think) in a completly functional style > 2: It actually *works*. It's pretty fast too. Running as an optimized > binary on my system (Athlon @ 950mhz under FreeBSD 5.1) it can > calculate > the first 15104 primes (Highest is 165161) with one minute of CPU time. For extra credit, have a look at the following bit of weirdness (though, I really think this thread belongs on the ocaml-beginners list). I think you will be surprised at how fast it runs, and I suspect it would be a good piece of example code for figuring out how to use lazy evaluation in Ocaml.