[erlang-questions] clarify: Sending big messages
Robert Virding
rvirding@REDACTED
Wed Oct 22 16:25:37 CEST 2008
2008/10/22 Kostis Sagonas <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.
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081022/8c699dce/attachment.htm>
More information about the erlang-questions
mailing list