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

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

[Octave-bug-tracker] [bug #29986] Minor: calling plot with no arguments


From: Rik
Subject: [Octave-bug-tracker] [bug #29986] Minor: calling plot with no arguments results in errors (instead of just usage)
Date: Fri, 11 Jun 2010 22:03:56 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9

Follow-up Comment #2, bug #29986 (project octave):

In general, functions should thoroughly check their input arguments before
proceeding with calculation in order to avoid Garbage In, Garbage Out.

Octave over time has grown to have 830 m-files and, unfortunately, not all of
them have been coded with input validation checks.

The case of plot.m is a little more obscure so I will put it aside for the
moment.

For quadl, however, the fix is very simple.  Take a look at legendre.m from
the Mercurial repository where I recently added better input validation. 
These lines should be at the beginning of every m-file.

if (nargin < 2 || nargin > 3)
  print_usage ();
endif

where the exact number of acceptable arguments varies between functions.  I
might slowly work through the m-files some time adding validation, but if you
have patches for any favorites like quadl I can apply them now.  Just attach
to this bug report.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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