[erlang-questions] On selective receive (Re: eep: multiple patterns)

Jay Nelson <>
Mon Jun 9 00:03:52 CEST 2008

There was a suggestion to have multiple channels and a request
of whether this is useful.

I previously suggested this (and was pre-dated by Ulf suggesting
something along those lines as well).  Neither of us got much
support.  Here is the background of my old post:

In general, I like the idea of channels.  The problem comes in the
implementation.  It would be enough just to have a control channel
so that a command to pause or exit could jump in front of a backlog
of messages, but a one off approach of a second channel is not
a very functional (as in fp) concept.

An fp approach would be to have an arbitrary number of channels
per message link and to be able to map across them or selectively
filter them.  The problem in erlang is two-fold: reasonable syntax
and reasonable standard performance.  Adding this feature could
complicate most code by requiring additional syntax, and could
also inhibit performance of non-complicated messaging.

As ROK indicated, there are ways to use multiple processes to
do the same thing.  It would be nice if someone came up with an
approach like ROKs that solved a useful set of problems, and then
encapsulated that in a parse transform that demonstrated how
to enhance the syntax to support such an approach.  That would
give a concrete solution to discuss the merits as a model for a
language enhancement.


More information about the erlang-questions mailing list