[eeps] EEP ???: Value-Based Error Handling Mechanisms

e@REDACTED e@REDACTED
Tue Sep 11 17:21:28 CEST 2018


On 09/11/18 17:19, Fred Hebert wrote:
> are you arguing in favor of GOTO instead of an operator?

i hope it was a temporary brownout of your mind.


> 
> On Tue, Sep 11, 2018 at 11:09 AM, e@REDACTED <mailto:e@REDACTED> 
> <e@REDACTED <mailto:e@REDACTED>> wrote:
> 
>              i'm sorry to interrupt,
>              but all you REALLY NEED is to tweak the "try..catch" a
>         little bit,
>              in a manner that the catch clause receives and returns
>              more comprehensible values, the values that are clearly linked
>              with the failed expressions and human readable.
> 
>              you do not need a new messy CRYPTIC operator.
> 
>              try
>                 {ok, Result} = foo(...)
>              , {ok, _} = foo2(...)
>              catch
>                {somehow_identify_which_line_failed,
>         unobscured_the_rightside_value}
> 
> 
>         This here is exactly the problem -- you can't somehow identify
>         which line failed unobscured with the right value.
> 
> 
>     [irrelevant technicalities skipped]
> 
>     so this problem should be solved.
>     exactly this problem.
>     and another operator is not a solution.
> 
>     option 1:
>     you introduce labels in the try's context
> 
>     try
>        a: {ok, Result} = foo()
>     , b: {ok, R} = foo2()
>     catch
>        {a, Error_Code, Actual_Return_Value} -> ...
>     ; {b, _} -> ...
>     end
> 
> 




More information about the eeps mailing list