bugGNU Octave - Bugs: bug #58519, anonymous function doesn't...

 
 

bug #58519: anonymous function doesn't remember certain variables

Submitter:  Olaf Till <i7tiol>
Submitted:  Sun 07 Jun 2020 10:58:40 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Olaf Till Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 13 Jun 2020 08:51:30 AM UTC, comment #2: 

Yes, checked with default branch changeset:

597e7cf93cac 2020-06-12 11:39:35 -0400

this is fixed. Thanks, and sorry for not having checked with a more current version...

Since I opened this report, I take the freedom to close it again.

Olaf Till <i7tiol>
Group Member
Thu 11 Jun 2020 01:52:31 PM UTC, comment #1: 

I believe that this problem is fixed after this changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/e760fef2829c

I also added a test that attempts to verify that the bug is fixed:

  http://hg.savannah.gnu.org/hgweb/octave/rev/bdd52f5e4170

John W. Eaton <jwe>
Group administrator
Sun 07 Jun 2020 10:58:40 AM UTC, original submission:  

With Octave development revision ... (I'll post the revision later, if still necessary, my connection to the machine with Octave broke in this moment), there is this error:

octave:9> fieldname = "a";
octave:10> structure = struct (fieldname, 1);
octave:11> anonfunc = @ () structure.(fieldname);
octave:12> anonfunc ()
error: 'fieldname' undefined near line 1, column 1
error: called from
    @<anonymous> at line 1 column 18
octave:13>

while in Octave-5.2, 'ans = 1' is returned, which is what I'd expect.

The issue is probably the cause of bug #57199, reported against the optim package with some version of Octave-6.0.

Olaf Till <i7tiol>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by i7tiol (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-13 i7tiol StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-06-11 jwe StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code