[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display of strings by interpreter
From: |
Rik |
Subject: |
Re: Display of strings by interpreter |
Date: |
Wed, 23 Oct 2019 10:33:57 -0700 |
On 10/23/2019 10:29 AM, John W. Eaton wrote:
> On 10/23/19 11:58 AM, Rik wrote:
>
>> Continuing with the theme of how results are displayed in Octave, should we
>> move to displaying char arrays and strings with enclosing single or double
>> quotes? This is how Matlab behaves, and I think it may be useful to
>> understanding when there are trailing spaces or null characters.
>>
>> Current behavior with Octave
>>
>> octave:1> "Hello World"
>> ans = Hello World
>>
>> Current behavior with Matlab
>>
>> "Hello World"
>> ans = "Hello World"
>>
>> 'Hello World '
>> ans = 'Hello World '
>> strtrim (ans)
>> ans = 'Hello World'
>>
>> This feature has been requested at
>> https://savannah.gnu.org/bugs/index.php?56973.
>
> Yes, this seems like a good thing to do. Also the feature request in
> #56974. I would even say that we could consider displaying the type if
> it is double.
>
Yes, it never made sense to me that Matlab would list the size and type for
all variables except double. Be consistent, and tell the user when it is a
double.
> Did you want to work on either of these?
>
I'll take a look at the string display issue.
--Rik