octave-maintainers
[Top][All Lists]
Advanced

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

Using upper case for variable names in error() strings


From: John W. Eaton
Subject: Using upper case for variable names in error() strings
Date: Thu, 6 Jan 2011 02:38:06 -0500

On  5-Jan-2011, Rik wrote:

| In Texinfo variables are marked with the @var{varname} macro.  In the Info
| browser displayed with 'help XXX' the macro translates to upper casing the
| variable name (VARNAME).  It seems like it would be useful to use upper
| case for variable names in strings in calls to error() so that 1) the
| warning message would match the documentation and 2) the actual problem is
| highlighted to the the user.
| 
| I recently tried this for the functions in scripts/statistics/base and it
| appeared nice to my eyes.  For example, from center.m,
| 
| ## @deftypefnx {Function File} {} center (@var{x}, @var{dim})
|   and later ...
| error ("center: DIM must be an integer and a valid dimension");
| 
| What do other people think?  It would be pretty simple to make a Perl
| script to extend this to all of Octave's functions.

That seems like a good change to me.  If you can make the change in a
semi-automatic way, then that would be even better.

jwe


reply via email to

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