Displaying 1 result from an estimated 1 matches for "00f343e0".
Did you mean:
003430
2004 Feb 03
3
Implementating streams in R
...unction in
cons.stream() . It would not work if I
implemented streams as simple list (see example at the very end of this
posting).
> head.stream(fib) # get the first element
[1] 1
> tail.stream(fib) # get the second element
[[1]]
[1] 2
[[2]]
function ()
expression
<environment: 00F343E0>
> tail.stream(tail.stream(fib)) # get the third element
[[1]]
[1] 3
[[2]]
function ()
expression
<environment: 01958774>
> accumulate.into.list(5,fibonacci.stream(0,1)) # construct a list with
the 5 first Fibonacci numbers
> accumulate.into.list(5,filter.odds(fibonacci.stre...