[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display order of structure elements changed in 2.9.7
From: |
David Bateman |
Subject: |
Re: Display order of structure elements changed in 2.9.7 |
Date: |
Wed, 27 Sep 2006 11:23:15 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Benjamin Lindner wrote:
> Hello list,
>
> I noticed a difference in the display order of structure elements in octave
> 2.9.7 compared to 2.9.6 and 2.1.73.
>
> octave-2.1.73:1:~
>
>> A.d=1; A.b=2; A.c=3; A.a=4
>>
> A =
> {
> a = 4
> b = 2
> c = 3
> d = 1
> }
>
> octave-2.9.6:1:~
>
>> A.d=1; A.b=2; A.c=3; A.a=4
>>
> A =
> {
> a = 4
> b = 2
> c = 3
> d = 1
> }
>
> octave-2.9.7:1:~
>
>> A.d=1; A.b=2; A.c=3; A.a=4
>>
> A =
> {
> d = 1
> b = 2
> c = 3
> a = 4
> }
>
> Is this change intentional?
> I did a look into the changelog file but did not find a hint concerning this.
>
> I know, the octave manual states that octave may print the elements of
> structures in any order (so basically one should not rely on a specific
> order), but - frankly said - I found the old behaviour of listing in
> alphabetical order very useful. it makes it much more user-friendly to read
> listings - especially if there are a large number of elements.
>
> Is there a chance to get the old behaviour back?
> Or - assuming that there is of course a good reason for the new behaviour -
> could one introduce an option to enable/disable alphabetic sorting? e.g. a
> builtin variable like struct_display_sort_order having either "alphabetic"
> and a second option?
>
> benjamin
>
>
Trying this under matlab R2006a I get
>> A.d=1; A.b=2; A.c=3; A.a=4
A =
d: 1
b: 2
c: 3
a: 4
seems its one of those stupidities to be compatiable with matlab. The
patch that affected this was "cvs diff -r 1.73 -r 1.74
src/ov-struct.cc" and the Changelog entry is
2006-07-06 John W. Eaton <address@hidden>
* ov-struct.cc (octave_struct::print_raw): Print keys in key_list
order.
Given, the matlab compatibility is considered more important that
compatibility with older versions of octave, I don't imagine this will
be changed...
Regards
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary