octave-maintainers
[Top][All Lists]
Advanced

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

Re: Can we deprecate/remove extra arguments currently accepted by numel?


From: Andrew Janke
Subject: Re: Can we deprecate/remove extra arguments currently accepted by numel?
Date: Fri, 15 Mar 2019 01:04:20 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.3



On 3/15/19 12:34 AM, John W. Eaton wrote:
Octave's numel function accepts extra arguments:

octave:1> help numel
'numel' is a built-in function from the file libinterp/corefcn/data.cc

  -- numel (A)
  -- numel (A, IDX1, IDX2, ...)
      Return the number of elements in the object A.
> [...snip...]

Does Matlab still accept this usage?  It does not appear to be documented now.

It may not be documented, but I believe that this calling form is still implicitly used by the Matlab runtime in conjunction with overloaded subsref and/or subsasgn for user-defined classes. (Remember when we were discussing subref/sugsasgn semantics in IRC a week or so ago and you were like, "WTF?"?) So, it's not just accepted, but required in some cases, WRT classdef classes.

Is the function numArgumentsFromSubsctript somehow related to this (apparently obsolete) way of calling numel?

I believe it is, but I'm not aware of any doco specifying how it works, or how it interacts with numel().

Cheers,
Andrew



reply via email to

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