[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Kudos to jwe on exception handling
From: |
Rik |
Subject: |
Re: Kudos to jwe on exception handling |
Date: |
Thu, 29 Oct 2015 15:00:04 -0700 |
On 10/29/2015 02:33 PM, Lukas Reichlin wrote:
>> On 06.10.2015, at 22:07, Rik <address@hidden> wrote:
>>
>> All,
>>
>> I wanted to give a shout out to jwe who has been doing exceptional (pun
>> intended) work transitioning the core away from using the global variable
>> error_state. The implementation began in Darmstadt just 2 weeks ago and if
>> I grep through libinterp for "error_state" from that time I find 1671
>> instances. Today, the number is down to 496. 70% of the instances have
>> been removed, and most of them it seems in just the last day. Hip Hip
>> Hurray!
>>
>> --Rik
>>
>>
>
> Nice pun :-) If I understood these changes correctly, it will be possible to
> write statements like below in oct-files:
>
> Matrix a = args(0).matrix_value ("function_name: error message")
>
> Octave will throw an error if args(0) cannot be converted to a matrix and
> will terminate the function without crashing?
>
> Well, that's just great!
Yes, it's really much cleaner. The old methodology always introduced an
extra indentation layer, frequently separated the error message from the
code which generated it, and was unfamiliar to those transitioning from
m-files to C++.
--Rik