bugGNU Octave - Bugs: bug #45893, classdef properties are not...

 
 

bug #45893: classdef properties are not reloaded when file is updated

Submitted by:  antonkulaga <antonkulaga>
Submitted on:  Mon 07 Sep 2015 08:47:49 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Need InfoAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 14 Sep 2015 09:21:54 PM UTC, comment #3:

As per the warning message, Matlab detects that the class was modified and that undefined behavior may occur until you "clear" any instances of that class. After "clear", the new defn is used.

I think the difference between ML and Octave is that "clear" is sufficient in Matlab whereas "clear classes" is required in Octave. Plus, no warning message.

Ceral Paquet <octavebugs>
Sat 12 Sep 2015 09:48:44 PM UTC, comment #2:

Is this a Matlab compatibility issue or just a user misunderstanding? Does Matlab automatically reload class properties when files are modified, or is a "clear <something>" required?

Mike Miller <mtmiller>
Project Administrator
Mon 07 Sep 2015 05:39:34 PM UTC, comment #1:

If you 'clear all' (or clear -classes) then it looks like Octave picks up the new class properties. In Matlab a 'clear' is sufficient.

MATLAB:

>> f=classfoo()


f =

classfoo with properties:

bar: 'value'
bar2: 1

%% Now modify the classfoo.m file to add a new property.

>> g=classfoo()

Warning: The class file for 'classfoo' has been changed, but the change cannot be applied because objects based on the
old class file still exist. If you use those objects, you might get unexpected results. You can use the 'clear'
command to remove those objects. See 'help clear' for information on how to remove those objects.

g =

classfoo with properties:

bar: 'value'
bar2: 1

>> clear
>> g=classfoo()


g =

classfoo with properties:

bar: 'value'
bar2: 1
bar3: 'test'

Ceral Paquet <octavebugs>
Mon 07 Sep 2015 08:47:49 AM UTC, original submission:

I cannot work with classdefs in Octave GUI because they are cached.

When I create and save a class with several properties and save it and then use it in the console the class is cached somewhere. When I add some new properties or change values of current ones I do not see such changes from octave console (inside GUI), so new props are not added, old props are not changed. It is a serious problem that forces me to move to Matlab in my project that I really do not want to do =((((

To reproduce the proble create a class

classdef foo
properties
bar = 'value'
end
end

then save the file and to console
$ myfoo = foo()
myfoo.bar

You will get 'value" for the bar. But then if you will add several other properties to the class they will not be found and if you change bar value in class description it will still display the oldone.

antonkulaga <antonkulaga>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by octavebugs (Posted a comment)
  • -unavailable- added by antonkulaga (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Sep 2015 09:48:44 PM UTCmtmillerItem GroupWTF, Matlab?!?=>Matlab Compatibility
      StatusNone=>Need Info
      Release4.0.0=>dev
      Summaryclassdefs are cached by GUI=>classdef properties are not reloaded when file is updated

    Back to the top


    Powered by Savane 3.1-cleanup1