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: Fri, 9 Dec 2016 21:07:59 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

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

To properly fix this problem, I think we need to untangle the disp, display,
and octave_value::print methods so that they work in a way that is both Matlab
compatible and predictable.

Currently, when an object is displayed (for example, by typing it's name at
the command prompt without a trailing semicolon), Octave calls the function
octave_value::print_with_name.  That function simply dispatches to the actual
octave_value type.  If the type is class or classdef, then the dispatching
currently happens inside the octave_class::print_with_name or
octave_classdef::print_with_name methods.  Maybe that's not the right thing to
do.  Maybe we should just be calling display for the object and let Octave's
normal dispatch rules choose which actual function to call.  As it is now, I
don't think you'll actually end up in the default display.m function for a
classdef object, even if there is no display method, will you?  Does that
actually happen?  If so, how?

The larger issue here is really how dispatching works generally.  We currently
have different ways to handle it for built-in objects and user-defined
classes.  So instead of just defining methods for @double or @struct, we
handle those specially, and then look up methods from inside the octave_class
and octave_classdef class methods that could be overloaded.  Maybe we need to
think about a different approach.

    _______________________________________________________

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]