|
| From: | John W. Eaton |
| Subject: | [Octave-bug-tracker] [bug #58695] Array is left empty if an element is a function call returning nothing |
| Date: | Wed, 8 Jul 2020 12:14:24 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 |
Follow-up Comment #14, bug #58695 (project octave):
Thanks for the info.
For functions defined without a list of outputs and called in a context where
nargout would be greater than zero, then I think the original intent in Octave
was to allow the call but fail or warn or attempt to do something reasonable
(if possible) when no outputs are created. So I could see a reasonable
argument made for allowing a function like this to return an empty
comma-separated list, similar to what a.x does for an empty struct array. But
it might also be simpler to just have the function evaluation code always fail
if nargout is greater than the number of declared outputs.
Similarly, I think Matlab throws an error if a function is called with more
inputs than can possibly be used but Octave allows it.
Maybe it is time for both of these things to be changed?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58695>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |