bugGNU Octave - Bugs: bug #41629, "set (h)" should not...

 
 

bug #41629: "set (h)" should not return read only properties

Submitted by:  Pantxo Diribarne <pantxo>
Submitted on:  Mon 17 Feb 2014 11:37:01 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 18 Mar 2014 03:35:29 PM UTC, comment #5:

I applied your changesets (http://hg.savannah.gnu.org/hgweb/octave/rev/8d5cb159fbc7, http://hg.savannah.gnu.org/hgweb/octave/rev/5264b0ec9f97). With this in place, I think I we can return back to bug #35511 and getting "reset (h)" to work.

Rik <rik5>
Project Administrator
Mon 17 Mar 2014 09:57:52 PM UTC, comment #4:

AFAICS there is no equivalent of base_graphics_object/graphics_object for proeprties, so that there is no way other than explicitly calling static function to call e.g axes::properties::... mehtods.
The two attached patches (to be applied one after the other) avoid static calls by implementing has_readonly_property for all graphics objects.

(file #30932, file #30933)

Pantxo Diribarne <pantxo>
Project Member
Mon 17 Mar 2014 01:27:14 AM UTC, comment #3:

I applied the two patches together and they appear to work. I'm uploading the consolidated changeset so you can see the final result.

One thing I wondered about was the dispatch table in the is_readonly function. Is there any way to get C++ to do this for us? Below is a small portion of the dispatch table.

It seems like there ought to be a way to call something like the following

because the object already knows what it is and has an overloaded instance of the has_readonly_property method depending on what kind of object it is. The syntax above doesn't work though.

(file #30923)

Rik <rik5>
Project Administrator
Wed 19 Feb 2014 12:18:47 PM UTC, comment #2:

Attached is a second patch (to be applied after the first one) that makes the original example work as expected.

(file #30606)

Pantxo Diribarne <pantxo>
Project Member
Tue 18 Feb 2014 04:12:56 PM UTC, comment #1:

I went ahead to propose a method to determine whether a variable is readonly.

In the attached changeset I modified genprops.awk to generate readonly_property_names/has_readonly_property methods. They are basically identical to core_property_names/has_core_property methods except they list read-only properties.

I also modified set methods in order to let them report if a property is read only:

If the approach is approved, I may address this bug.

(file #30596)

Pantxo Diribarne <pantxo>
Project Member
Mon 17 Feb 2014 11:37:01 PM UTC, original submission:

In octave the following returns true:

As in Matlab, "tightinset" is read only and the test should return false.

I could not find a way (but try/catch) to determine programmatically whether a property is read only, neither in octave language, nor on the c++ side.

Pantxo Diribarne <pantxo>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #30923:  ro_props.cset added by rik5 (8KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by pantxo (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 Mar 2014 03:35:29 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 17 Mar 2014 09:57:52 PM UTCpantxoAttached File-=>Added readonly_part1_bug41629.patch, #30932
      Attached File-=>Added readonly_part2_bug41629.patch, #30933
    Mon 17 Mar 2014 01:27:14 AM UTCrik5Attached File-=>Added ro_props.cset, #30923
    Wed 19 Feb 2014 12:18:47 PM UTCpantxoAttached File-=>Added report_readonly_2_bug41629.patch, #30606
    Tue 18 Feb 2014 04:12:56 PM UTCpantxoAttached File-=>Added report_readonly_bug41629.patch, #30596

    Back to the top


    Powered by Savane 3.1-cleanup1