bugGNU Octave - Bugs: bug #29821, save('-mat', ... ) no longer saves...

 
 

bug #29821: save('-mat', ... ) no longer saves global variables

Submitter:  chieh <chieh>
Submitted:  Fri 07 May 2010 07:03:04 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  highegg
Originator Name:  Chieh Open/Closed:  * Closed
Release:  * 3.2.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 13 May 2010 06:39:39 PM UTC, comment #4: 

It seems a reasonable idea for mark_global to create a variable if it doesn't exist.  The opposite use case doesn't make sense to me.  Why would you call 'global (varname)' if you didn't want access to varname immediately (assuming it exists) or didn't intend to do something with it later (in which case creating the variable now isn't a problem)?


Rik <rik5>
Group administrator
Thu 13 May 2010 09:54:56 AM UTC, comment #3: 

Fixed on savannah:
http://hg.savannah.gnu.org/hgweb/octave/rev/d406d91aa9c3

perhaps the functions
symbol_table::mark_global and symbol_table::mark_persistent should force a non-existing variable to be created? Is there some code relying on the opposite behavior?

Jaroslav Hajek <highegg>
Sat 08 May 2010 02:36:47 AM UTC, comment #2: 

I'm reopening this bug report because I think the proper behavior should be that if a variable is not already global, loading a file with a global variable should insert the variable into the global symbol table and also make it visible in the current scope.  Octave currently inserts the value into the global symbol table, but it does not make it visible in the current scope.

John W. Eaton <jwe>
Group administrator
Fri 07 May 2010 10:43:11 PM UTC, comment #1: 

This works correctly in the development version (tested today 5/7/2010).  Please try compiling a new version of Octave from sources.

Rik <rik5>
Group administrator
Fri 07 May 2010 07:03:04 PM UTC, original submission:  

If you run this code and try to load the test.mat file, the global variable is not saved at all.



global p;
p = 'dkfjdkfj'
s = 'this is s'

save('-binary','test.mat', 's', 'p')

chieh <chieh>

 

(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 highegg (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by chieh (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
    2010-05-13 rik5 Open/ClosedOpen Closed
    2010-05-13 highegg StatusConfirmed Fixed
        Assigned toNone highegg
    2010-05-08 jwe StatusInvalid / Not an Octave Bug Confirmed
        Open/ClosedClosed Open
    2010-05-07 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code