[erlang-questions] Return value: optimization?
Sun Feb 1 16:37:38 CET 2015
It's to inform Dialyzer that yes, we really do want to ignore the
returned value. Should have no impact on execution otherwise.
On 02/01/2015 04:12 PM, Roberto Ostinelli wrote:
> Dear list,
> I was going through cowboy's code and I keep on seeing patterns such as
> _ = cowboy_req:reply(Status, Req), 
> or this one:
> _ = case TRef of
> undefined -> ignore;
> TRef -> erlang:cancel_timer(TRef)
> end, 
> All of these are done when we're there's no tail recursion. So now I'm
> curious: what is the purpose of explicitly assigning an anonymous
> variable to these expressions? Is this some kind of memory optimisation
> I'm just now aware of?
> erlang-questions mailing list
More information about the erlang-questions