octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using C++ exceptions instead of error_state


From: Rik
Subject: Re: Using C++ exceptions instead of error_state
Date: Fri, 25 Sep 2015 10:37:09 -0700

On 09/24/2015 09:00 AM, address@hidden wrote:
Subject:
Re: Using C++ exceptions instead of error_state
From:
Carlo De Falco <address@hidden>
Date:
09/24/2015 12:16 AM
To:
Michael Godfrey <address@hidden>
CC:
"John W. Eaton" <address@hidden>, "address@hidden" <address@hidden>
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0
References:
<address@hidden> <address@hidden> <address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset="us-ascii"
Message:
1

On 23 Sep 2015, at 17:20, Michael Godfrey <address@hidden> wrote:
> On 09/23/2015 02:47 PM, John W. Eaton wrote:
>> I've revisited this change and updated my patch so that it applies to the current sources.  I'm attaching the new version to this message.
>> 
>> To summarize, the idea is to change the error function to throw an exception so that we can eliminate the use of the global error_state variable over time (likely a very long time).
>> 
>> Is there any objection to going ahead with this change?
>> 
>> jwe
> Seems to me a very good plan. I vote to apply the change.
> Michael
Seems like a very good idea to me to.
I would just suggest revising this manual page as well pith the patch:
http://www.gnu.org/software/octave/doc/interpreter/Exception-and-Error-Handling-in-Oct_002dFiles.html#Exception-and-Error-Handling-in-Oct_002dFiles
So at least we don't get any new code that uses error_state.

c.
jwe,

I tested the patch and it passes 'make check' just fine.  I did some benchmarking with 'time make check' and it is 0.5-1.0% slower than before.  This is repeatable, not a one time effect, but the amount is so small it is well worth it for the improved code structure.  As an example, I noticed that it already clears up a double printing of an error that I get with "eval ('@(x x.^2')".  I think we should move in this direction.

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]