grabbag_macros::recurrence! [] [src]

macro_rules! recurrence {
    ( $seq:ident [ $ind:ident ]: $sty:ty = $($inits:expr),+ ... $recur:expr ) => { ... };
}

Expands to an expression implementing the Iterator trait, which yields successive elements of the given recurrence relationship.

For example, you can define a Fibonnaci sequence iterator like so:

recurrence![ fib[n]: f64 = 0.0, 1.0 ... fib[n-1] + fib[n-2] ]