I don't know the semantics of the MS functions so maybe this mirrors them, but the implementations of take-while and drop-while remove an "extra" element from the argument channel, right?
user> (def c (chan)) #'user/c user> (go (doseq [i (range 10)] (>! c i))) #<ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@13f452d> user> (def d (take-while even? c)) #'user/d user> (<!! (go (<! d))) 0 user> (<!! (go (<! c))) 2 take-while pulled down the 1 and discovered it didn't pass the predicate, and there's no way to put it back. On Sun, Jun 30, 2013 at 2:27 PM, Brandon Bloom <brandon.d.bl...@gmail.com>wrote: > Hi all, > > Today, primarily for my own edification, I've been implementing as many > Microsoft Reactive Extensions operators as I can using core.async. The > results have been *spectacular*. core.async is an absolute pleasure to work > with. I'm so happy with how they have turned out, that I really want to > share. > > You can find my work-in-progress here: > https://github.com/brandonbloom/asyncx > > The primary file of interest is: > https://github.com/brandonbloom/asyncx/blob/master/src/asyncx/core.clj > > At the time of this message, I've implemented the bulk of the relevant > operators described here: > http://msdn.microsoft.com/en-us/library/hh242961(v=vs.103).aspx > > All of my implementations utilize parking operations, so this library > should be fully portable to ClojureScript. > > My notes describe any difference from Rx, notable omissions, and known > issues: > https://github.com/brandonbloom/asyncx/blob/master/notes > I'll probably work more on this tonight and will update my notes as I go. > > Rich & team: I understand that you guys will probably take a run at > implementing this sort of library in the not too distant future. Please let > me know if and how I can contribute to that effort. > > Cheers, > Brandon > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure." [Larousse, "Drink" entry] -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.