octave-maintainers
[Top][All Lists]
Advanced

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

Re: f77_exception_encountered


From: Paul Kienzle
Subject: Re: f77_exception_encountered
Date: Thu, 1 Apr 2004 21:41:49 -0500


On Apr 1, 2004, at 6:24 PM, John W. Eaton wrote:

Next, we check to see why we are inside this if block.  If it is
because an f77 exception has occurred (i.e., xstopx has been called)
then we print an error message and exit the if block (the
F77_XFCN_ERROR macro just prints a message).  So I think the
additional check of f77_exception_encountered after F77_XFCN is still
needed.

Okay, obviously I didn't read it closely enough.  I was thrown by the
redundant error message in F77_XFCN_ERROR and in code such
as dbleQR.cc, both of which say something like, "error encountered
in subroutine XXX".  I guess you don't want to move error_state into
liboctave?

We could change F77_XFCN_ERROR or F77_XFCN to throw a C++ exception
here.  But if we do that, I think we will need to have a different way
of printing tracebacks.  For example, we will need to catch exceptions
everywhere we need to print traceback information.  At the same time,
we should rething the use of error_state and error(), so that error()
throws an exception instead of just printing a message and setting
error_state.  I'm in favor of making changes like this because it will
mean less code in user functions, and makes the C++ error() more like
the Octave scripting error() function, but it will be a significant
amount of work to make it all happen.

Exceptions might be nice, but I haven't worked enough with them to
know.  Certainly checking error_state and freeing resources
cleanly is a pain.  However, fixing something that ain't broke is
low on my priority list ;-)

Paul Kienzle
address@hidden



reply via email to

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