Laurent PETIT a écrit :
>
> 2009/2/24 Christophe Grand <christo...@cgrand.net 
> <mailto:christo...@cgrand.net>>
>
>
>     Laurent PETIT a écrit :
>     > Hello,
>     > What about giving back 'lazy-cons (or lcons as a shortcut), with the
>     > optional possibility to give the cons an internal name ?
>     It would work and that's why Stuart said "without resorting to code in
>     clojure-contrib":
>     (defn fibo[]
>     (seq-utils/rec-cat fib [0 1] (map + fib (rest fib))))
>
>
> Wow, I think now is time for me to also try to learn more the stuff 
> that is in clojure-contrib !
>
> Anyway, it was interesting to try doing it by tweaking clojure itself :-)

Prior to r1300 it was even easier: no change to Clojure was required.

> Could'nt it be interesting to consider adding the possibility to make 
> self recursive calls inherent to lazy-seqs, as I proposed ?

While having played a lot with rec-cons, rec-cat and rec-seq — which can 
prove useful in simplifying some code —, I'm still ambivalent about the 
general case of recursive data structures in functional programming 
that's why I'm not lobbying for their inclusion in core.

> Have you looked at the patch I provided ?

Yes: simple and clever.

Christophe

-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to