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

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

[Octave-bug-tracker] [bug #62011] addRequired of inputParser raising "pr


From: Maxim Gawrilow
Subject: [Octave-bug-tracker] [bug #62011] addRequired of inputParser raising "protected access" error
Date: Wed, 9 Feb 2022 05:48:26 -0500 (EST)

Follow-up Comment #3, bug #62011 (project octave):

GNU/Linux is correct. (sorry, forgot to login before posting)

I was able to narrow down the strange behaviour to a very obscure edge case.
When the function is called in a cleared ("clear all") environment, it works
without a problem.
However, by accident I had typed "@inputParser" in the command window (I know,
not a useful command), and after that calling the function created the strange
error.
In order to reproduce it should be sufficient to reduce the function to the
bare minimum:

function parsertest(varargin)
p = inputParser();
p.addRequired("pack", @ischar);
p.parse(varargin{:});
endfunction


Then
'clear all; parsertest("mech")'
works without problems, but
'@inputParser; parsertest("mech")'
not. Any subsequent useless command like '@bla' does not prevent the error
from happening, only a 'clear all' does.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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