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: Sun, 31 Dec 2017 09:06:43 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/31/2017 05:04 AM, ederag wrote:

Let's hope they think it over.

I don't think that they will.

But I guess python will remain superior to matlab for string handling.

I may agree with you, but I also suppose that is subjective.

https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
especially
"": interpreted (like octave)
r"": raw (like current matlab)
not to mention the handy f"" format...

Let's say that r"" mean raw string in octave too.

If you want this in Octave, then it has to be the other way around.

"" is compatible with Matlab, always.

i"" or e"" or something means "interpolated escape sequences in this string".

One way to maintain octave's nice behavior while allowing
to use or distribute packages compatible with matlab
would be a way to declare _files_ as "matlab braindead".
The "pkg load" or initialization script would perform the declaration.
Especially for pkg load, this would be deterministic and transparent to the 
user.

Instead of braindead, borrowing Dan's suggestion, it could be
interpconfig({files}, '-defaultStringType', 'escape');

For these marked files, "" would be interpreted as r"" strings.

Since it affects only the interpretation of a file,
it seems safer and easier to maintain
than the old global --braindead that is definitely discarded.

No, we are not doing any of that. Sorry, but as I said, we've been down that path before and we are not doing it again. Do I have to throw in a "this is non-negotiable"? :-)

jwe



reply via email to

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