octave-maintainers
[Top][All Lists]
Advanced

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

recent change for "string enum varibles"


From: John W. Eaton
Subject: recent change for "string enum varibles"
Date: Tue, 18 May 2010 02:04:25 -0400

In the recent change for "string enum variables", you introduced a
function

  octave_value
  set_internal_variable (int& var, const octave_value_list& args,
                         int nargout, const char *nm, const char **choices,
                         int nchoices)

Which relies on NCHOICES properly counting the number of elements of
CHOICES.  I've generally tried to avoid things like this in Octave
since it is easy for the number of elements of a variable wrong.  If
there is some good reason to avoid using a string_vector, std::list
(or some other  standard container), then how about using 0 to mark
the last element of CHOICES so you don't have to count the number
of elements but instead look for 0 as the end of the array?

jwe


reply via email to

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