octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #49794] display vs. disp functions


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #49794] display vs. disp functions
Date: Sat, 10 Dec 2016 11:41:56 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #14, bug #49794 (project octave):

Rik: Yes, it works if you do something like


  x = blah ();  ## blah is a class
  display (x)


but


  x = blah ()


alone does not call display.  I think it should.  So the dispatch seems
backward to me.

I'm thinking of something more like the attached patch that always calls the
"display" method for an object, and that simply prints a name tag and then
calls disp to actually print the values.

But the attached patch is not complete, and certainly not appropriate for
stable.  We would also need to install "display" and "disp" methods for the
built-in classes (double, single, logical, etc.) so that it would not be easy
to screw up displaying those types simply by creating a global function called
"display".

So, for stable, I guess it is OK to fix the bug in whatever way works with the
fewest surprises.  But I don't think we can be fully compatible until we are
calling "display" directly when an expression doesn't end with a semicolon,
and then "display" should call "disp", same as Matlab does.


(file #39193)
    _______________________________________________________

Additional Item Attachment:

File name: diffs.txt                      Size:5 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49794>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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