[erlang-bugs] A funny bug

Erik Søe Sørensen <>
Thu Aug 15 15:41:08 CEST 2013

On 02-08-2013 16:57, Ulf Wiger wrote:
> So arguably, a way to parameterize receive *should* be available, and *should* be documented. I'm not saying that prim_eval:'receive'/2 is that very thing that should be documented, but it comes close enough that Erlang wizards like Tony should not only be excused for playing around with it, but should be *expected* to. ;-)
An alternative "parameterized receive" method is this:


(Disclaimer: self plug)

It takes a compiled match spec, like so:

     dyn_sel_recv:match_spec_receive(CMS, 1000)

which is presumably safer than allowing any closure to be called.


More information about the erlang-bugs mailing list