bugGNU Octave - Bugs: bug #31692, 'error' function behaves different...

 
 

bug #31692: 'error' function behaves different from MATLAB, causing program to stop

Submitter:  None
Submitted:  Thu 18 Nov 2010 10:44:38 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Daniel Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.2
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 20 Nov 2010 12:45:06 AM UTC, comment #3: 

The report that prompted this change back in September of 2009 was not reported on the bug tracker.  I don't know whether it was even reported on a public mailing list.  I can't seem to find a message about it in the archives either.

John W. Eaton <jwe>
Group administrator
Fri 19 Nov 2010 09:48:05 AM UTC, comment #2: 

Thanks, very nice.

But why doesn't that show up when I search for e.g. "error empty" here:

http://savannah.gnu.org/bugs/?func=search&group=octave

I also tried to Nabble the old mailing lists, but didn't find this fix...

Sorry for the double post
and thanks again.

Anonymous
Thu 18 Nov 2010 07:19:31 PM UTC, comment #1: 

This incompatibility has already been eliminated:

http://hg.savannah.gnu.org/hgweb/octave/rev/ef45d191d833

John W. Eaton <jwe>
Group administrator
Thu 18 Nov 2010 10:44:38 AM UTC, original submission:  

According to the MATLAB documentation, the function 'error' will not interfere with the program if called with an empty argument:

http://www.mathworks.com/help/techdoc/ref/error.html

"...empty...no effect...no action is taken..."

This allows constructions like


error(nargchk(2,3,nargin))


instead of


if (nargchk(2,3,nargin)), error(nargchk(2,3,nargin)), end


where nargchk() produces a string "too many", "too few" or an empty string if the number of input arguments is valid.

Would it be possible to have Octave's error() function behave in the same way, i.e. ignoring empty arguments?

Anonymous

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by None (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-11-18 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code