[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matlab-compatible string class
From: |
Julien Bect |
Subject: |
Re: Matlab-compatible string class |
Date: |
Thu, 28 Dec 2017 06:38:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
Le 27/12/2017 à 23:47, John W. Eaton a écrit :
With this change:
http://hg.savannah.gnu.org/hgweb/octave/rev/0b65949870e3
we are beginning to handle the existence of the Matlab string class
that is now created in Matlab when double quoted strings are used. I
expect that it will not be too long before users will expect full
compatibility in this area. But I'm not sure how we will transition
from Octave's current behavior for double-quoted string constants to
the one now used by Matlab. For example, in Octave "foo\n" is a
4-element character array containing 'f', 'o', 'o', and a linefeed
character. In Matlab it is a string object, but it also contains 5
characters, 'f', 'o', 'o', '\', and 'n'. I'm sure there are other
differences, but this is sure to cause some trouble. I don't see a
smooth transition path. Does anyone have any ideas about what to do?
I don't if this is feasible but here is a suggestion :
1) Maintain both behaviors and provide a flag to select the desired one.
2) Use the "old behavior" for now, since the the change is still recent
(R2016b I gather) and probably the support for string arrays won't be
complete in the next releases.
3) Make the transition to the new behavior when the support is
considered as complete, while still providing the flag to support the
old behavior.
4) Remove the old behavior much much later.
@++
Julien