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

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

[Octave-bug-tracker] [bug #65153] Unexpected error when using the ~ outp


From: Denis Sbragion
Subject: [Octave-bug-tracker] [bug #65153] Unexpected error when using the ~ output placeholder
Date: Tue, 6 Feb 2024 02:03:34 -0500 (EST)

Follow-up Comment #16, bug#65153 (group octave):

Hello,

I saw some other unexpected behaviour with isargout() and the output
placeholder and before filing a new bug I post it here because I don't know if
the changes introduced with this bug also fix what I see.

Considere the following code:


function isatest()
        [ ~, a2 ] = isat1();
        
        [ ~, a2, ~ ] = isat1();
endfunction

function [ a1, a2, a3 ] = isat1()
        [ nargout(), isargout(1:3) ]
        
        [ a1, a2, a3 ] = isat2();
endfunction

function [ a1, a2, a3 ] = isat2()
        [ nargout(), isargout(1:3) ]
        
        a1 = a2 = a3 = 1;
endfunction


It produces the following output:


octave:24> isatest()
ans =

   2   0   1   0

ans =

   3   1   1   1

ans =

   3   0   1   0

ans =

   3   1   1   1


>From the output above:

- isargout() and nargout() don't propagate to inner calls. I don't know if
this is expected but if it is it makes both functions less useful.

- Adding a trailing ~ to a function call cause nargout to increase. I agree
that adding a trailing ~ makes little sense, but is this expected?

Bye,

Denis


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65153>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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