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
Hi,
On Fri, Nov 19, 2010 at 11:44 AM, babui jmgim...@gmail.com 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
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 christo...@cgrand.net wrote:
Hi,
On