octave-maintainers
[Top][All Lists]
Advanced

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

Re: Octave 2.1.57 available for ftp


From: Paul Kienzle
Subject: Re: Octave 2.1.57 available for ftp
Date: Fri, 12 Mar 2004 21:47:17 -0500


On Mar 12, 2004, at 6:06 PM, John W. Eaton wrote:

On 12-Mar-2004, Paul Thomas <address@hidden> wrote:

| Has anybody done an inventory of the N-d features available on the other
| product?

Here is my current list of things that need to be done for Octave that
may involve fairly basic N-d functionality:

  ...
  orderfields

I've been puzzling over how to handle orderfields for a while.  This
comes up in mex support, wherein octave uses a map (which is
inherently unordered) and matlab uses a vector of field names,
which new fields added at the end.

The problem is that map cannot guarantee traversal order as you
are adding keys.  In the case of a mex file, it means that if the
programmer is lazy and always does mxSetFieldByNumber
without first doing mxGetFieldNumber, then this could fail
if the user adds new fields.

I don't see how to do fix mex and implement orderfields without
scrapping the use of map, or at a minimum, turning it into a map
from string to cell into a map from string to cell index, and using
a cell array of one dimension more than the dimension of the
structure array to represent the data.  Other than the funny
indexing (e.g., x.a may return a comma separated list), a struct
really is a cell array with string names for one of the axes.

BTW,  are two structs with differing field orders equal or not
equal?

Paul Kienzle
address@hidden



reply via email to

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