[Top][All Lists]

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

Re: Matlab-compatible string class

From: ederag
Subject: Re: Matlab-compatible string class
Date: Fri, 29 Dec 2017 12:41:05 +0100
User-agent: KMail/4.14.10 (Linux/4.4.79-18.23-default; KDE/4.14.25; x86_64; ; )

On Wednesday, December 27, 2017 17:47:50 John W. Eaton wrote:
> 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?
> jwe

The octave way is much smarter.
The double quote string is like a C string, very intuitive.
Changing that would be a regression, IMHO.

Could it be possible to expand escaped characters like \n
to '\', 'n' only in the --braindead mode ?


reply via email to

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