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: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65153] Unexpected error when using the ~ output placeholder
Date: Tue, 6 Feb 2024 02:26:55 -0500 (EST)

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

That looks like the expected behavior to me.  See my comments below.


function isatest()
        [ ~, a2 ] = isat1();  ## nargout => 2, isargout(1:3) => [0, 1, 0]

        [ ~, a2, ~ ] = isat1(); ## nargout => 3, isargout(1:3) => [0, 1, 0]
endfunction

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

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

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

        a1 = a2 = a3 = 1;
endfunction


What do you mean by "isargout() and nargout() don't propagate to inner calls"?
 Where do you expect them to get their values from?  The only reasonable place
is the immediate caller.

"Adding a trailing ~ to a function call cause nargout to increase ... is this
expected?"

Yes, ~ counts as an output, it is just not assigned to anything


    _______________________________________________________

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]