Pure (programming language): Difference between revisions

Content deleted Content added
No edit summary
Examples: trial division is not a form of the Sieve. it is a different algorithm with different complexity
Line 67:
</pre>
 
While Pure uses [[eager evaluation]] by default, it also supports [[Lazy evaluation|lazy]] data structures such as streams (lazy [[List (computing)|lists]]). For instance, here is a (suboptimal) trial division version of the [[Sieve of Eratosthenes#Trial division|sieve of Eratosthenes]] (attributed to [[David Turner (computer scientist)|David Turner]]'s algorithm<ref>Turner, David A. SASL language manual. Tech. rept. CS/75/1. Department of Computational Science, University of St. Andrews 1975.</ref>) whichfor computescomputing the stream of all [[prime numbers]] by [[trial division]] can be expressed in Pure:
 
<pre>