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: Rik
Subject: Using upper case for variable names in error() strings
Date: Wed, 05 Jan 2011 20:01:03 -0800

1/5/10

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.

--Rik





reply via email to

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