You can use drop-while, partition & iterate to implement fixed point rather easily in Clojure, FYI.
http://vimeo.com/9460060 I show this at about the 9 minute mark. The code's uglized on git hub, will fix & post later. Sean On May 23, 5:27 pm, Taliesin <[email protected]> wrote: > This is a very useful predicate, I happened to write it myself for > Mathematica just a few days ago. > > Speaking of which -- at some point I want to do a thorough comparison > between Clojure and Mathematica, which in my opinion has some > absolutely top-notch higher-order functions. Just as an example: > FixedPoint[function, expression], which keeps applying a function to > expression until the result no longer changes. Using this simple > pattern one can do breadth-first tree traversal in essentially one > line of Mathematica code. Very very cool. > > On May 23, 3:21 pm, Michael Gardner <[email protected]> wrote: > > > I need to use a predicate to divide one list into two, one containing all > > values for which the predicate is true, and the other with all remaining > > values. I can do this easily by filtering twice, once with the predicate > > and once with its complement, but is there some core or contrib function > > that will do this more directly and efficiently? I'm not sure what the best > > way to search for something like this would be. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to [email protected] > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
