Hi Timothy, I've picked case over cond/condp because I want a O(1) dispatch rather than linear execution since there are many patterns [though I'm probably guilty of premature optimization here].
I've currently been working around it via two techniques: ** Refactoring it into a function. i.e. (defn some-func [msg] (hmatch msg ... )) ;; silly is called hmatch (async/go (loop [msg (<! some-chan)] (some-func msg) (recur (<! some-chan)))) ** And when I can't refactor, due to needing to interact with other parts of go, manually expand it, i.e. (async/go (loop [msg (<! some-chan)] (case (:tag msg) :dog (... some op involving some-chan)))) Please let us know when the next release of core.async is ready -- looking forward to it! PS: I'm a big fan of your youtube tutorials. :-) On Tue, Feb 18, 2014 at 12:42 PM, Timothy Baldridge <tbaldri...@gmail.com> wrote: > "When a macro expands to case inside of a go-block, it appears that > the _ELSE_ clause of the case is always run. (Even after a previous > clause has matched.)" > > Thanks, I'll get a test in the project for this, it'll probably be fixed in > the next alpha release. Until then, cond or condp might work? > > Timothy > > > On Tue, Feb 18, 2014 at 1:40 PM, t x <txrev...@gmail.com> wrote: >> >> @Thomas: >> (this is completely unrelated to the actual bug) >> >> This particular code was "simplified" from a more complicated macro >> -- where for the else clause, I want to capture the original value, so >> it would be something like: >> >> >> (silly obj >> :dog dog-line >> cat cat-line) ==> >> >> (case (:tag obj) >> :dog dog-line >> (let [cat obj] cat-line )) >> >> However, in "simplifying" the example, parts of the macro was >> removed, and thus it appears that we have this dangling cat symbol. >> >> >> >> >> >> On Tue, Feb 18, 2014 at 12:09 PM, Thomas Heller <th.hel...@gmail.com> >> wrote: >> > Well, while case allows for symbols it still doesn't make sense to use >> > it >> > except :tag switches between keywords and symbols to. Apart from that >> > cat >> > "pat2" is never actually used. >> > >> > (defmacro silly [object pat1 body1 pat2 body2] >> > `(case (:tag ~object) >> > ~pat1 ~body1 >> > ~body2)) >> > >> > >> > >> > But as Timothy said its probably related to case, so I'll shut up. >> > >> > On Tuesday, February 18, 2014 8:20:07 PM UTC+1, Ben wrote: >> >> >> >> On Tue, Feb 18, 2014 at 11:18 AM, Thomas Heller <th.h...@gmail.com> >> >> wrote: >> >>> >> >>> While I haven't tested the code, I can see one "obvious" mistake. >> >>> >> >>> https://github.com/txrev319/bug-report/blob/master/src/app.cljx#L20 >> >>> >> >>> "cat" is undefined? >> >>> >> >> >> >> That isn't a mistake. `silly` expands into a case, which expects bare >> >> symbols. >> >> >> >> -- >> >> 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. >> >> -- >> 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. > > > > > -- > "One of the main causes of the fall of the Roman Empire was that-lacking > zero-they had no way to indicate successful termination of their C > programs." > (Robert Firth) > > -- > 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. -- 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.