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

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

[Octave-bug-tracker] [bug #49198] inputParser remembers values between c


From: Carlo de Falco
Subject: [Octave-bug-tracker] [bug #49198] inputParser remembers values between calls to parse
Date: Tue, 27 Sep 2016 13:42:41 +0000 (UTC)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:48.0) Gecko/20100101 Firefox/48.0

URL:
  <http://savannah.gnu.org/bugs/?49198>

                 Summary: inputParser remembers values between calls to parse
                 Project: GNU Octave
            Submitted by: cdf
            Submitted on: Tue 27 Sep 2016 03:42:39 PM CEST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0-rc2
        Operating System: Any

    _______________________________________________________

Details:

Hi,

I noticed this behaviour of the inputParser class:


>> p = inputParser;
>> p.addParameter ('a', [])
>> p.addParameter ('b', [])
>> p.parse ('a', 1)
>> p.Results
ans =

  scalar structure containing the fields:

    a =  1
    b = []

>> p.parse ('b', 1)
>> p.Results
ans =

  scalar structure containing the fields:

    a =  1
    b =  1



This is inconsistent with Matlab behaviour and (to my understanding)
to the inputParser documentation:



>> p = inputParser;
>> p.addParameter ('a', [])
>> p.addParameter ('b', [])
>> p.parse ('a', 1)
>> p.Results

ans = 

    a: 1
    b: []

>> p.parse ('b', 1)
>> p.Results

ans = 

    a: []
    b: 1

>> 






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49198>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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