bugGNU Octave - Bugs: bug #38555, Strange behaviour of nargout

 
 

bug #38555: Strange behaviour of nargout

Submitted by:  None
Submitted on:  Wed 20 Mar 2013 02:13:09 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Peter SøndergaardOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.3
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 20 Mar 2013 09:14:47 PM UTC, comment #3:

Confirmed on the stable branch. The problem has already been fixed on the development branch and is unlikely to be backported. I would suggest building from Mercurial development sources or waiting for the next major release of Octave (3.8.0 or 4.0.0).

Rik <rik5>
Project Administrator
Wed 20 Mar 2013 08:13:31 PM UTC, comment #2:

Here is the example again. In a freshly started Octave:

octave:1> nargout("sombrero")
error: nargout: invalid function
octave:1> sombrero;
octave:2> nargout("sombrero")
ans = 3

So the nargout function only works correctly after the sombrero function has been called once. This works the same way for other .m files

Anonymous
Wed 20 Mar 2013 05:08:54 PM UTC, comment #1:

Your example seems to be missing from the bug report. Could you re-post the sample code necessary to see the bug?

Rik <rik5>
Project Administrator
Wed 20 Mar 2013 02:13:09 PM UTC, original submission:

There is an option of nargout to call it with the name of a function, and then it returns the number of optional output arguments of that function. However, if that function has not been called before in the current Octave session, nargout will fail to find the function.

Steps to reproduce:

In a freshly started Octave, type:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Mar 2013 09:14:47 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1