octave-maintainers
[Top][All Lists]
Advanced

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

Re: line continuations


From: José Abílio Matos
Subject: Re: line continuations
Date: Thu, 20 Feb 2020 17:25:08 +0000

On Thursday, 20 February 2020 17.10.07 WET Nicholas Jankowski wrote:
> so the problem isn't that it is or isn't a char array.  the problem is that
> matlab only accepts character vectors.  any arrays must either be string or
> cell arrays. (and Octave doesn't do strings yet).

You are right, I should have been more clear. :-)

> It's generally not a bug for Octave to have capability that extends beyond
> Matlab, which is what appears to be the case here.  multidimensional arrays
> are always stored column-wise (despite most of us reading row-wise), and
> that's no different here.
>
> I see no reason to throw an error, unless you see lack of an error message
> causing some other problem?

My main objection to this extension is semantic. The function is called 
strrep. The help of that function says:

"""
 -- NEWSTR = strrep (STR, PTN, REP)
 -- NEWSTR = strrep (CELLSTR, PTN, REP)
 -- NEWSTR = strrep (..., "overlaps", VAL)

Replace all occurrences of the pattern PTN in the string STR with the string 
REP and return the result.
"""

My objection is that an example like the one we have been using
c = ['1 2 3';'4 5 6']

where IMHO c is not a string. I called it an array of chars to distinguish 
from a vector of chars.

So if the input is wrong the usual procedure is to throw an error.

OTOH probably this is a fringe case not worth the time we are spending. :-)

The goal of my original message on this sub-thread was to understand if this 
is worth pursuing or not.

Thank you for your feedback. :-)
-- 
José Matos





reply via email to

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