Closed dehubbed closed 10 years ago
Note that this coincidentally works with most :after statements since in the case of an odd number of body expressions the macro assumes the first expression is the optional binding vector. So this works if the first pattern is a vector. Vector-based patterns are common but not a requirement.
@dehubbed Thank you!
The following example from the comments in the code to actors/receive fails:
(receive :else m :after 30 :foo)
This is because :after statements, e.g.
:after 20 :foo
, have an odd number of expressions, so adding an :after statement turns a body with an otherwise even count of expressions into a body with an odd count. The assert-args statement https://github.com/puniverse/pulsar/blob/master/src/main/clojure/co/paralleluniverse/pulsar/actors.clj#L480 counts the expressions before removal of the :after statement, it should do so after, e.g. like so: