bugGNU Octave - Bugs: bug #61471, Automatic check of too many inputs

 
 

bug #61471: Automatic check of too many inputs

Submitter:  Guillaume <gyom>
Submitted:  Fri 12 Nov 2021 05:54:50 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 17 Nov 2021 01:24:21 PM UTC, comment #5: 

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 15 Nov 2021 12:16:55 PM UTC, comment #4: 

Thank you, it now works as expected.

Guillaume <gyom>
Fri 12 Nov 2021 08:20:23 PM UTC, comment #3: 
John W. Eaton <jwe>
Group administrator
Fri 12 Nov 2021 06:48:51 PM UTC, comment #2: 

It seems the difference happens if "()" is present in the function definition. I guess it should but it is not mandatory?

Guillaume <gyom>
Fri 12 Nov 2021 06:03:27 PM UTC, comment #1: 

Hmm, it seems to work for me:


octave:1> type testnoinput
testnoinput is the user-defined function defined from: /net/devtty/scratch/jwe/build/octave-gcc-11/testnoinput.m

function testnoinput ()
endfunction

octave:2> testnoinput
octave:3> testnoinput (1)
error: testnoinput: function called with too many inputs
error: called from
    testnoinput
octave:4> a = testnoinput (1)
error: testnoinput: function called with too many inputs
error: called from
    testnoinput
octave:5> a = testnoinput ()
error: testnoinput: function called with too many outputs
error: called from
    testnoinput


John W. Eaton <jwe>
Group administrator
Fri 12 Nov 2021 05:54:50 PM UTC, original submission:  

The NEWS document for Octave 7.1 says "Calling a user-defined function with too many inputs or outputs is now
an error.  The interpreter makes this check automatically.". It seems to work for me with outputs but not inputs:


octave:1> version
ans = 7.0.0
octave:2> type testnoinput
testnoinput is the user-defined function defined from: /tmp/testnoinput.m

function testnoinput
endfunction

octave:3> testnoinput (1)
octave:4> a = testnoinput (1)
error: testnoinput: function called with too many outputs
error: called from
    testnoinput


Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-17 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-11-12 jwe StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code