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

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

[Octave-bug-tracker] [bug #48656] overridden class subsref method may ge


From: Tasos Papastylianou
Subject: [Octave-bug-tracker] [bug #48656] overridden class subsref method may get wrong value for nargout
Date: Tue, 18 Jul 2017 21:00:50 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #5, bug #48656 (project octave):

Please reopen this as a bug.

Compare the below octave output with the matlab output.


%%% Matlab (ignoring undefined variable errors):
x = [foo(), foo(), foo()];
x.whatever                    % ans = 3
[out] = x.whatever            % ans = 3
[~, out] = x.whatever         % ans = 2
[~, ~, ~, out] = x.whatever   % ans = 4

%%% Octave (ignoring undefined variable errors):
x = [foo(), foo(), foo()];
x.whatever                    % ans = 3
[out] = x.whatever            % ans = 3
[~, out] = x.whatever         % ans = 3
[~, ~, ~, out] = x.whatever   % ans = 3


You can see that, unless it's 0 or 1, matlab _does_ in fact take into account
the number of arguments requested.

(PS. I also note bug #48693 is related and open; the behaviour there is also
more compatible with matlab's behaviour here, though not identical since the 0
and 1 cases differ.)

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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