octave-maintainers
[Top][All Lists]
Advanced

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

Re: fdisp and legacy OO classes


From: John W. Eaton
Subject: Re: fdisp and legacy OO classes
Date: Fri, 08 Feb 2013 17:29:30 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 02/08/2013 01:05 PM, Rik wrote:
2/8/13

I've noticed that running 'make check' now prints out some annoying garbage
in the middle of the tests about s1.gick, s2.gick, s3.gick.  The source of
messages is a few new xtests at the bottom of the test_classes.m function.

I first thought that it was just about a missing semicolon on the end of a
line, but it turns out the problem is much deeper.  Basically, the
display() routine which gets called when Octave needs to print a class
object is always routing output to stdout.  The test.m function is trying
to route this output to a file but fdisp doesn't work.

I've filed a bug (https://savannah.gnu.org/bugs/index.php?38286) about it
and added an example there.  I know the OO interface is seeing some
attention currently, so maybe this can be looked at by someone involved
with that work.

The problem that I noted about things like

  fdisp (fid, {class_object})

not working properly happen because fdisp ultimately calls octave

  octave_cell::print_raw (std::ostream& os, bool) const

to display the cell array, then that calls
octave_value::print_with_name for each element of the cell.  That
function dispatches to octave_class::print_with_name for class
objects, and that function only looks up "display", not "disp" or
"fdisp".

I'm not sure how this should be fixed.  How can
octave_class::print_with_name know that it was called from fdisp or
disp rather than display?  I'm afraid that some significant
refactoring needs to be done for us to have proper dispatching for
functions like this.

jwe


reply via email to

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