[Top][All Lists]

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

Re: Matlab-compatible string class

From: Daniel J Sebald
Subject: Re: Matlab-compatible string class
Date: Fri, 29 Dec 2017 14:58:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 12/29/2017 07:22 AM, John W. Eaton wrote:
On 12/29/2017 06:41 AM, ederag wrote:

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

No, we've been down that path before and we won't do it again. It makes it too difficult to write code that will just work if the meaning of the language can change based on some option. What happens when you pass your code that requires "\n" to mean LF to someone who uses Octave with --braindead?

Could make such an option software settable, e.g.,

interpconfig('-stringtype', 'escape');

That avoids the command-line configuration option, but interpconfig() function wouldn't be backward compatible; not the most egregious problem though. It would be something like:

if (compare_versions(version(), "4.4.0", ">="))
  interpconfig('-stringtype', 'escape');

That would be fairly backward compatible, I would think.

In some sense, the above is analogous to the "tex" setting of graphics text:

octave:45> get(get(gca,"title"), "interpreter")
ans = tex

With that in mind, a alternate approach would be to add such an option to all the functions that use strings. That is, leave the interpretation/use of the string to the very last moment. How to display such strings at the command line (i.e., escape or non-escape) is arbitrary I suppose then, but how important that is, I don't know.


reply via email to

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