octave-maintainers
[Top][All Lists]
Advanced

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

Re: Deprecating usage ()


From: John W. Eaton
Subject: Re: Deprecating usage ()
Date: Fri, 13 Apr 2012 13:41:50 -0400

On 13-Apr-2012, Rik wrote:

| On 04/13/2012 10:00 AM, address@hidden wrote:
| > Message: 1
| > Date: Thu, 12 Apr 2012 15:33:32 -0400
| > From: "John W. Eaton" <address@hidden>
| > To: octave maintainers mailing list <address@hidden>
| > Subject: deprecate "usage" function?
| > Message-ID: <address@hidden>
| > Content-Type: text/plain; charset=us-ascii
| >
| > Octave has both "print_usage" and "usage". We should be using
| > "print_usage" internally in Octave because it extracts the usage
| > message directly from the doc string so there can't be any difference
| > between the function documentation and the usage message that is
| > displayed when functions are called incorrectly. So I don't see any
| > particular need for the "usage" function. Is there any objection to
| > deprecating the "usage" function and eventually removing it from
| > Octave?
| >
| > jwe
| 4/13/12
| 
| Good idea.  I had noted the redundancy but hadn't done anything about it.
| 
| It seems to be used in only 2 core Octave m-files at present:
| 
| ./miscellaneous/license.m:        usage ('license ("inuse")');
| ./miscellaneous/license.m:        usage ('retval = license ("inuse")');
| ./miscellaneous/license.m:        usage ('retval = license ("checkout",
| feature)');

Hmm, the license function also uses a style of docstring that we don't
usually recommend.  But using print_usage for it should be fine.

| ./plot/private/__errcomm__.m:      usage ("%s (...)", caller);

Private functions shouldn't need usage messages.

jwe


reply via email to

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