octave-maintainers
[Top][All Lists]
Advanced

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

Re: rewrite of structs - advice sought


From: John W. Eaton
Subject: Re: rewrite of structs - advice sought
Date: Wed, 23 Jun 2010 09:07:16 -0400

On 23-Jun-2010, Jaroslav Hajek wrote:

| On Tue, Jun 22, 2010 at 10:49 PM, John W. Eaton <address@hidden> wrote:
| > On 22-Jun-2010, Jaroslav Hajek wrote:
| >
| > | On Tue, Jun 22, 2010 at 5:20 PM, John W. Eaton <address@hidden> wrote:
| > | > On 22-Jun-2010, Jaroslav Hajek wrote:
| > | >

| > I don't object to the new names, but it looks like the old ones could
| > be trivially preserved.  I also don't object to marking the old names
| > as deprecated.
| 
| Yes, I intended to do this later, they're not there yet so that I can
| find and fix usages more easily.

Isn't it also possible to mark a function as deprecated so GCC will
warn you each time it is used?

| I'm OK with adding the Cell version (and marking as deprecated), but I
| think the octave_value version should not be in octave_map. It should
| be in octave_scalar_map where it logically belongs (because it only
| works with scalar structs), or not exist at all.

OK.  Scalar structures were added to Octave a long time ago.  They
were converted to arrays after Matlab introduced structure arrays.
And, if I recall correctly, they were converted first to 2D objects,
then later made N-dimensional.  So that may explain why we have so
much inconsistency here.

| It still seems to me that it would be better to leave Octave_map in
| place and simply deprecate it as whole, so that developers become
| aware of the changes and choose the more suitable replacement.

OK, I agree with this given that preserving the iterator behavior
would be somewhat difficult.  To make the transition easier, I
think it would be best to preserve as much of the old interface as
possible in the new class so that people can move most of their code
to the new class by simply renaming Octave_map to octave_map.  Any
functions that use obsolete names or that have been replaced by
something better could be deprecated using the GCC attribute and
perhaps a comment in the header file saying what the preferred
replacement is.

If the new code is working and tests are passing, then I'd say check
it in when you are ready.  I can help convert uses of Octave_map in
Octave to use the new classes.

Thanks,

jwe



reply via email to

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