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

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

[Octave-bug-tracker] [bug #50640] display function not passing arguments


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50640] display function not passing arguments to overloaded version of function
Date: Wed, 29 Mar 2017 08:34:20 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #7, bug #50640 (project octave):

Guillame:  In response to your comment #3, what does Matlab do if you define a
display method for a class like this:


function display (a1)
  nargin
  class (a1)
  inputname (a1)
  disp (a1)
end


and again like this:


function display (a1, a2)
  nargin
  class (a1)
  inputname (a1)
  disp (a1)
  class (a2)
  inputname (a2)
  disp (a2)
end


?

Based on other comments that I remember seeing (in another report?) I think
they both might work, and nargin will be 1 in the first case and 2 in the
second.  If so, then I think the thing to do is check the number of arguments
that the display method expects and if it is greater than or equal to 2, call
it with the object and the variable name so that they display method can
handle all of the output (including the "NAME =\n\n" part, if it chooses to do
that).  Otherwise, call it with just the object as a single argument.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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