octave-maintainers
[Top][All Lists]
Advanced

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

Re: Deprecate nfields function?


From: Carnë Draug
Subject: Re: Deprecate nfields function?
Date: Sat, 1 Mar 2014 18:54:39 +0000

On 1 March 2014 16:49, Carnë Draug <address@hidden> wrote:
> On 1 March 2014 16:21, Rik <address@hidden> wrote:
>> Would anyone be heartbroken if we deprecated the nfields function in
>> version 4.2?  It is not used in any m-files in the core and I didn't even
>> realize it existed until I was trolling through the documentation.  nfields
>> returns the number of fieldnames in a structure and can be easily replaced
>> with 'numel (fieldnames (x))'.
>
> I just gave a quick check on Octave Forge and couldn't find any usage
> of this function. I agree with removing it.

On 1 March 2014 18:06, Lukas Reichlin <address@hidden> wrote:
> Yes, I'm using it in the control package and I think it's a handy function.

Ups. My apologies. I forgot to update the repositories before saying
that it is not used in octave Forge. It seems you started to use it
recently.

After updating all the repositories, it seems only the control package
uses this function, and only to check if a struct is empty, not to
actually get the number of fields. Note that isempty in an empty
struct actually returns false:

octave-cli-3.8.0:1> s = struct ();
octave-cli-3.8.0:2> isempty (s)
ans = 0

Carnë


reply via email to

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