[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref()
From: |
Fernando |
Subject: |
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods |
Date: |
Thu, 6 Apr 2023 05:33:02 -0400 (EDT) |
Follow-up Comment #21, bug #63841 (project octave):
Here is a patch that fixes both the problem from the original post and the
problem from comment #11. It passes all the tests (at least, those not
skipped), including those provided by @arb.
The idea of this patch is to differentiate the case when the number of output
arguments resulting from evaluating an expression is unkown a priori (and the
expression is not a complete statement). In this case, we call the
corresponding evaluate method with the argument nargout=-1.
I think it would be good to also add a test for these cases
>> A=tst_nargout;
>> if A(1:5).a_property,true,end
nargout=1, s(1).type = ()
ans =
logical
1
>> for x=A(1:5).a_property,true,end
nargout=1, s(1).type = ()
ans =
logical
1
It is different form the case
if cm('first').a_property, true, end
because A(1:5).a_property actually returns several outputs, of which only the
first one should be taken, while cm('first').a_property returns only one
output.
(file #54566)
_______________________________________________________
Additional Item Attachment:
File name: bug-63481-fix2.diff Size:4 KB
<https://file.savannah.gnu.org/file/bug-63481-fix2.diff?file_id=54566>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63841>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/01
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/02
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, A.R. Burgers, 2023/04/02
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/03
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/03
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, A.R. Burgers, 2023/04/04
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/04
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods,
Fernando <=
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/06
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/07
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/07
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, A.R. Burgers, 2023/04/10
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, A.R. Burgers, 2023/04/13
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, John W. Eaton, 2023/04/13
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Markus Mützel, 2023/04/13
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/13
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, John W. Eaton, 2023/04/13
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Fernando, 2023/04/13