[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optiona
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optional parameter with argument |
Date: |
Wed, 6 Jul 2022 14:43:51 -0400 (EDT) |
Update of bug #62639 (project octave):
Priority: 5 - Normal => 2
Item Group: Unexpected Error or Warning => Undocumented Matlab
Release: 7.1.90 => dev
_______________________________________________________
Follow-up Comment #12:
I think this is an edge case which is undocumented Matlab behavior (likely an
artifact of the implementation) and therefore Octave shouldn't try too hard to
try and duplicate this. For reference, Matlab documentation for addOptional
(https://www.mathworks.com/help/matlab/ref/inputparser.addoptional.html) does
not mention this fallback behavior of interpreting a positional argument as a
Parameter if the name matches.
And there is an easy workaround here. If the programmer wants a positional
argument then use addOptional. If they want a name/value pair then use
addParameter. It seems odd to define an input scheme one way (positional) and
then expect it to work the other way around as well.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62639>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/