octave-maintainers
[Top][All Lists]
Advanced

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

Re: Matlab-compatible string class


From: John W. Eaton
Subject: Re: Matlab-compatible string class
Date: Thu, 28 Dec 2017 17:00:31 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/28/2017 03:39 PM, Mike Miller wrote:
On Wed, Dec 27, 2017 at 17:47:50 -0500, John W. Eaton wrote:
I
don't see a smooth transition path.  Does anyone have any ideas about what
to do?

If we agree that it's important to support Matlab's double quote syntax
eventually, then we should probably start by discouraging the use of
backslash-escaped sequences in double quoted strings and other likely
incompatibilities.

Do you think we should do that now? If so, then something like the attached diff will do it, but it will be very noisy because it will warn about all strings with escape sequences. It would be a lot better if we could skip the warning if the string appears as the format argument of a function that will do backslash escape processing for single-quoted strings (and, presumably, string objects), but that will require quite a bit more work.

We can start to implement the string data type without changing the
meaning of double quoted literals. We can implement the string() and
strings() constructor functions to create string objects without the
need for any change in how double quotes are interpreted.

Yes, we can create a string class independent of the way double-quoted strings are handled. This would probably be a good test for the classdef and is likely to uncover some bugs or missing features.

After the type is supported, then we can look at changing how the
interpreter handles the double quoted literal string.

Yes.  This is the painful part...

jwe

Attachment: backslash-warning-diffs.txt
Description: Text document


reply via email to

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