bugGNU Octave - Bugs: bug #45503, Saved function handles may be...

 
 

bug #45503: Saved function handles may be incorrect

Submitted by:  asherikov <asherikov>
Submitted on:  Thu 09 Jul 2015 03:41:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.1Operating System: BSD

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 09 Jul 2015 05:16:09 PM UTC, comment #1:

This is a known issue with saving function handles to subfunctions. Already reported as bug #36686, closing as a duplicate report.

Mike Miller <mtmiller>
Project Administrator
Thu 09 Jul 2015 03:41:29 PM UTC, original submission:

If a script file contains many functions, they are not properly identified by their handles stored in a data file.

Example of a script file:
-----
function test_struct = testfcn()
test_struct.some_function_handle = @some_function;
end

function a = some_function()
a = true;
end
-----

It can be used as
-----
a = testfcn();
a.some_function_handle(); % returns 'true'
-----

However, after the structure 'a' was saved and loaded, the function handle is not restored properly
-----
save a.mat a;
load a.mat;
a.some_function_handle(); % now calls 'testfcn()' instead of 'some_function()'
-----

Contents of the data file:
-----
# name: a
# type: scalar struct
# ndims: 2
1 1
# length: 1
# name: some_function_handle
# type: function handle
# octaveroot: /usr/local
# path: /usr/home/aleks/testfcn.m
some_function
-----

asherikov <asherikov>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by asherikov (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Jul 2015 05:16:09 PM UTCmtmillerStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
      Dependencies-=>Depends on bugs #36686

    Back to the top


    Powered by Savane 3.1-cleanup1