[erlang-questions] clarify: Sending big messages

Bill McKeeman Bill.McKeeman@REDACTED
Wed Oct 22 16:42:09 CEST 2008

The Armstrong book says

A ! B ! C ! msg

is convenient when one message must go several places.  It seems simple enough to add a line with void or ok to your function if that is what you want.

/s/ Bill

From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Robert Virding
Sent: Wednesday, October 22, 2008 10:26 AM
To: Kostis Sagonas
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] clarify: Sending big messages

2008/10/22 Kostis Sagonas <kostis@REDACTED<mailto:kostis@REDACTED>>
Zoltan Peter Toth wrote:
> Hi,
> We have a function like this:
> deliver(Port, Data) ->
>     Port ! {data, Data}.
> This function returns Data.

Nope.  This function returns {data, Data}.

I personally think that !/2 returning a value instead of being void as
it should, is a design flow in the definition of the language. (*)

Trouble is there is no void data type and every expression must return a value. So we decided that as it must return something it might as well return something useful, so why not the message? Personally I think this is better than returning 'ok' or 'void'.

How would you handle a void return anyway? Can you put in a tuple and send it? Or just return it and never use it, except to return it again as in the deliver example.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081022/bcf60f54/attachment.htm>

More information about the erlang-questions mailing list