bugGNU Octave - Bugs: bug #49198, inputParser remembers values...

 
 

bug #49198: inputParser remembers values between calls to parse

Submitter:  Carlo de Falco <cdf>
Submitted:  Tue 27 Sep 2016 01:42:39 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.0-rc2 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Sep 2016 02:48:29 PM UTC, comment #2: 

It seems also other properties need to be reset before a new parse, new patch attached.



(file #38614)

Carlo de Falco <cdf>
Group Member
Tue 27 Sep 2016 01:52:53 PM UTC, comment #1: 

The attached extremely simple patch seems to fix the issue.


(file #38607)

Carlo de Falco <cdf>
Group Member
Tue 27 Sep 2016 01:42:39 PM UTC, original submission:  

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

>>


Carlo de Falco <cdf>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #38614:  open_WBiiajrv.txt added by cdf (1KiB - text/plain)
file #38607:  open_CSrcwL8m.txt added by cdf (766B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by cdf (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-10 rik5 Open/ClosedOpen Closed
    2016-09-28 cdf Attached File- Added open_WBiiajrv.txt, #38614
        Open/ClosedClosed Open
    2016-09-28 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-09-27 cdf Attached File- Added open_CSrcwL8m.txt, #38607
        StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code