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

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

[Octave-bug-tracker] [bug #31692] 'error' function behaves different fro


From: anonymous
Subject: [Octave-bug-tracker] [bug #31692] 'error' function behaves different from MATLAB, causing program to stop
Date: Thu, 18 Nov 2010 10:44:40 +0000
User-agent: Opera/9.80 (Windows NT 5.1; U; nb) Presto/2.6.30 Version/10.63

URL:
  <http://savannah.gnu.org/bugs/?31692>

                 Summary: 'error' function behaves different from MATLAB,
causing program to stop
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 18 Nov 2010 10:44:38 AM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: Daniel
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.2
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

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?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31692>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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