octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test in Matlab request [classdef]


From: Michael Goffioul
Subject: Re: Test in Matlab request [classdef]
Date: Sun, 2 Feb 2014 14:34:09 -0500

On Sat, Feb 1, 2014 at 7:04 PM, Michael D. Godfrey <address@hidden> wrote:
On 02/01/2014 04:34 PM, Michael Goffioul wrote:
Thanks. However this is not exactly the result I was expecting, especially for properties. I partially reproduced the example mentioned here [1]. Would you mind trying to reproduce that example (as in the link below) and check whether you get the same result as in the documentation?

Michael.

Best to go with a newer Matlab. I only have access to the 2009 version.
OK?

To be honest, sometimes I've the impression that documented features are more the side-effect of a particular implementation than a real design decision.

In this particular case, my last example demonstrates that any objects that inherit from clA are implicitly casted to clA when being accessed from a clA method. I can understand that for the object context (the equivalent of "this" in C++), but this is much less obvious for other objects. However it seems to happen for any object: method arguments (other than the object context) and even clB objects created explicitly in the method.

So I'm wondering whether it's worth to duplicate such behavior. Especially as this behavior has changed from previous Matlab versions (either it was a bug fix, or they changed the implementation and the new behavior is just a side-effect). This can even become a bit messier if you consider that "get" and "set" accesses can be defined independently on a property (although Matlab documentation seems to indicate that it'll throw an error when parsing the derived class).

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]