octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref()


From: Rik
Subject: [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods
Date: Mon, 27 Feb 2023 11:28:03 -0500 (EST)

Follow-up Comment #9, bug #63841 (project octave):

Comment #8 (subsref works for (), not for {} or .) seems consistent with the
changeset that jwe identified by bisection.  That cset begins with


+          // Attempt to set up a proper value for nargout at least in the
+          // simple case where the cs-list-type expression - i.e., {} or
+          // ().x, is the leading one.
+          bool maybe_cs_list_query = (type[0] == '.' || type[0] == '{'
+                                      || (type.length () > 1 && type[0] ==
'('
+                                          && type[1] == '.'));
+
+          if (maybe_cs_list_query)
+            {
+              // Set up a proper nargout for the subsref call by calling
numel.
+              octave_value_list tmp;
+              if (type[0] != '.') tmp = idx.front ();
+              nargout = xnumel (tmp);
+            }


The comment in the code about the variable "maybe_cs_list_query" implies that
this is about calculating the specific cases of "{}" and ".". 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63841>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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