octave-maintainers
[Top][All Lists]
Advanced

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

Re: Classdef test required on Matlab


From: Michael Goffioul
Subject: Re: Classdef test required on Matlab
Date: Sun, 19 Jan 2014 17:03:45 -0500

On Sun, Jan 19, 2014 at 12:36 PM, Lukas Reichlin <address@hidden> wrote:
On 19.01.2014, at 17:42, Michael Goffioul <address@hidden> wrote:

> Could someone test the following in Matlab? Put all files into a single dir, then run "runAll".
>
> Thanks,
> Michael.
>
> <clA.m><clB.m><clC.m><runAll.m>

Here you go :-) R2013a on a Mac.

Cheers,
Lukas

>> runAll
>>> calling aa.getPropFromA
>>> clA::subsref

ans =

    10

>>> calling bb.getPropFromA
>>> clA::subsref

ans =

    10

>>> calling bb.getPropFromB
>>> clA::subsref

ans =

    10

>>> calling cc.getPropFromC
>>> clA::subsref

ans =

    10

>>

Thanks. However, this is rather unexpected. I was reading documentation about overloading subsref [1] and the documentation says that built-in subsref is always called from withing class methods. So unless I'm mis-reading the doc, the first case should at least not have called clA::subsref. This doesn't make sense...

Michael.


[1] http://www.mathworks.com/help/matlab/matlab_oop/indexed-reference-and-assignment.html#br09nsm


reply via email to

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