I was just saying that not returning something that is a pair, for
example nil, is good enough.

 (unfold (fn [x] (when (<= x 10)  [(* x x) (inc x)])) would work.

Both function can be written with each other anyway.

And they don't have the same number of args so they are compatible
with each other.

On Thu, Sep 16, 2010 at 8:05 PM, Gijs S. <gijsstuur...@gmail.com> wrote:
> Finished is a predicate which designates when the seed is exhausted.
> Because seed is not necessary a sequence, finished is not always
> empty?.
>
>
>
> For instance:
>
>
>
> => (unfold (fn [x] [(* x x) (inc x)]) #(> % 10) 0)
>
> (0 1 4 9 16 25 36 49 64 81 100)
>
>
>
> Or the zipmap (zip2) example from the wikipedia page.
>
>
>
> Although the first example wanders back into territory where the
> existing sequence functions such as iterate, take-while and for would
> suffice.
>
> -Gijs
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> 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



-- 
Sent from an IBM Model M, 15 August 1989.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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