API for lazy-seqs
- ()
by Stephen C. Gilardi
Usage:
(ns your-namespace
(:require clojure.contrib.lazy-seqs))
Overview
==== Lazy sequences ====
primes - based on the "naive" implemention described in [1] plus a
small "wheel" which eliminates multiples of 2, 3, 5, and
7 from consideration by incrementing past them. Also inspired
by code from Christophe Grand in [2].
fibs - all the Fibonacci numbers
powers-of-2 - all the powers of 2
==== Lazy sequence functions ====
(rotations, partition-all, shuffle, rand-elt moved to seq_utils.clj)
(permutations and combinations moved to combinatorics.clj)
[1] http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf
[2] http://clj-me.blogspot.com/2008/06/primes.html
Public Variables and Functions
fibs
function
Usage: (fibs)
Returns a lazy sequence of all the Fibonacci numbers.
Source
powers-of-2
function
Usage: (powers-of-2)
Returns a lazy sequence of all the powers of 2
Source
primes
var
Lazy sequence of all the prime numbers.
Source