[erlang-questions] is there "return" in Erlang.

Masklinn masklinn@REDACTED
Mon Feb 28 16:36:41 CET 2011


On 2011-02-28, at 15:46 , Ulf Wiger wrote:
> On 28 Feb 2011, at 14:15, Jesper Louis Andersen wrote:
> 
>> The problem here is that doSomeThing(a); is done for its side-effect
>> only. The only possible side-effect in Erlang is that it communicates
>> with other processes
> 
> Well, there are other ways - all of which could be modelled using processes,
> but in fact aren't (updating ets tables or the process dictionary, for example),
> but I agree with your point, and want to emphasise it.
> 
> One thing that will grow in importance as you learn to appreciate the differences
> between pure and impure code, is that code like this - which can *only* be useful
> through side-effects - has a toxic effect on your code structure.
> 
In this precise case though, pure-but-extremely-expensive functions would probably have a similar effect (though not completely unrecoverable from, as opposed to impure functions).


More information about the erlang-questions mailing list