2009/2/24 Christophe Grand <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 :-) Could'nt it be interesting to consider adding the possibility to make self recursive calls inherent to lazy-seqs, as I proposed ? It's a one line change in a clojure class, and a one line change in lazy-seq also. And I don't think it would have performance impacts for people not willing to use that. Have you looked at the patch I provided ? Regards, -- Laurent > > (Btw, Stuart, due to latest changes in Clojure's lazy-seq > implementation, rec-seq is atom-based again.) > > Christophe > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---