[eeps] EEP ???: Value-Based Error Handling Mechanisms
Fred Hebert
mononcqc@REDACTED
Tue Sep 11 17:19:56 CEST 2018
are you arguing in favor of GOTO instead of an operator?
On Tue, Sep 11, 2018 at 11:09 AM, e@REDACTED <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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/eeps/attachments/20180911/a82e00ba/attachment.htm>
More information about the eeps
mailing list