Am 16.01.21 um 01:41 schrieb Allin Cottrell:
On Sat, 16 Jan 2021, Sven Schreiber wrote:
> Hi,
> when using cnameset (and presumably also rnameset) with input that
> doesn't match the dimensions, nothing happens. See here:
>
> <hansl>
> matrix m = ones(2) # column
> cnameset(m, defarray("a","b")) # doesn't match, should give
an error?
> print m
> </hansl>
>
> I wonder if an error should be thrown instead? Or else perhaps the first
> available elements of the array should be used?
Meybe, but it's operating per documentation: requiring a number of
strings equal to the number of columns and returning non-zero on error.
? matrix m = ones(2)
Generated matrix m
? eval cnameset(m, defarray("a","b"))
Hi,
as it returns an error value, I don't think an error should be thrown
(which would lead to a full stop I guess - if not catched). The user is
responsible for testing the returned value in this case.
Artur