help-octave
[Top][All Lists]
Advanced

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

Re: accessing "sub-structs"


From: John W. Eaton
Subject: Re: accessing "sub-structs"
Date: Sat, 6 Jun 2009 12:22:39 -0400

On  6-Jun-2009, Jaroslav Hajek wrote:

| Some time ago there was a proposal to allow cs-lists being specified
| as dynamic field indices, i.e.
| 
| ss = s.(fields{:}); # fields is a cell array
| ss = s.("a","b");

Since s.("a") produces a cs-list, I would think that s.("a", "b")
should also produce a cs-list, probably with the with the "a" elements
followed by the "b" elements, so

  ss = s.("a", "b")

would not make sense, but

  ss = {s.("a", "b")}

would.

| But I would prefer to see examples of real-life usage first.

I agree.  Would this change solve a problem that actually comes up
often enough to justify the effort of implementing the feature?  Also,
if we make a change like this, it's possible that the MathWorks will
introduce some other meaning for the same syntax in Matlab, and then
we would likely be forced to change Octave.  I'd rather avoid that.

jwe


reply via email to

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