Thanks for your explanation which has allowed me to make this
definition
(def fibs
(list* 0 1 (lazy-seq (map + fibs (rest fibs)
that uses rest and IMHO is clearer that the first one using drop.
Juan Manuel
On 19 nov, 12:04, Christophe Grand wrote:
> Hi,
>
>
>
>
>
> On Fri, Nov 19, 201
Hi,
On Fri, Nov 19, 2010 at 11:44 AM, babui wrote:
> I've been playing with lazy sequences defined by autoreferential
> definition. For instance:
>
> (def ones (lazy-seq (cons 1 ones)))
>
> which is equivalent to (def ones (repeat 1)).
>
> My problem arises when defining the sequence of fibonacc
I've been playing with lazy sequences defined by autoreferential
definition. For instance:
(def ones (lazy-seq (cons 1 ones)))
which is equivalent to (def ones (repeat 1)).
My problem arises when defining the sequence of fibonacci numbers.
With this definition:
(def fibs
(lazy-seq (list* 0 1