octave-maintainers
[Top][All Lists]
Advanced

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

Re: important for OF maintainer - ismatrix backwards incompatible change


From: Carnë Draug
Subject: Re: important for OF maintainer - ismatrix backwards incompatible change in octave 4.0
Date: Mon, 16 Feb 2015 12:54:26 +0000

On 13 February 2015 at 08:43, Andreas Weber <address@hidden> wrote:
> Am 13.02.2015 um 00:52 schrieb Carnë Draug:
>
>> A full replacement / fix would be replacing all current ismatrix() with
>> "isnumeric (x) || islogical (x) || ischar (x)".  More details on the bug
>> report [1] and cset [2].
>
> Michael Godfrey suggested in Comment #2
> (https://savannah.gnu.org/bugs/index.php?42422) to keep the original
> "ismatrix" implementation
>
>   retval = arg.is_matrix_type ()
>            || arg.is_scalar_type ()
>            || arg.is_range ();
>
> as "isarray". I like this approach, any other thoughts?

I also liked this idea but after giving it some thought, it occurred to
me that pretty much everything in Octave is an array.  Even cell array
and struct arrays.  And even scalar structs are a 1x1 struct array.  Such
function would not go well with the nomenclature in the rest of Octave.

Also, such function is used for input checking and it will be rare the case
where a numeric, character, and logical arrays are equally valid inputs.
So maybe we don't really need the function we had  and should instead be
using isnumeric, ischar, and islogical as appropriate.

My only problem with this change is, should we change the meaning of the
is_matrix_type() C++ method?  Because at the moment, ismatrix() in Octave
means having two dimensions, while is_matrix_type() in liboctave means char,
numeric, or logical array.  Having two separate meanings for functions
with the same name is confusing.  Can we also change the liboctave method?

Carnë



reply via email to

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