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

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

[Octave-bug-tracker] [bug #49536] many functions that expect a "string"


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #49536] many functions that expect a "string" silently truncate char matrix arguments (octave_value::string_value)
Date: Mon, 7 Nov 2016 20:02:29 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #4, bug #49536 (project octave):

Thanks for the testing Ceral.

Philip ­- it could be argued that Octave behaves slightly worse here, because
it is silently throwing away data. At least with the few examples I've shown
here, Matlab either gives the entire array (yes, it is flattened in column
major order, but it's complete), or throws an error saying that the argument
must be a vector.

I would propose that Octave could do one of three things to make this better

1. Always return the entire array, squeezed into a vector following the normal
column-major ordering.

2. Issue a warning while doing what it does today.

3. Throw an error when code tries to extract a string_value from an argument
that has more than 1 non-singleton dimension.

Any of these changes can be made in just one place, in the
octave_char_matrix_str::string_value method, and affect any function that
tries to get a simple string from one of its arguments.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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