[erlang-questions] How about a new warning? Was: Re: trouble with erlang or erlang is a ghetto

Anthony Shipman als@REDACTED
Wed Aug 3 13:05:26 CEST 2011


On Wed, 3 Aug 2011 10:52:55 am Sam Bobroff wrote:
> Quite often when debugging I want to add a new line or two to a function,
> to examine or check an intermediate value. e.g.:
>
>  ...
>  Result = function_call(),
>  validate(Result),

I find a show function useful

show(Name, Value) ->
    io:format("~s ~p\n", [Name, Value]),
    Value.

noshow(_, V) -> V.

validate(show("result", function_call())).

-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.



More information about the erlang-questions mailing list