octave-maintainers
[Top][All Lists]
Advanced

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

Re: classdef array objects


From: John W. Eaton
Subject: Re: classdef array objects
Date: Thu, 12 Sep 2013 10:12:21 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 09/12/2013 09:44 AM, Michael Goffioul wrote:

I can see various potential problems with the suggested storage scheme:

1) how would you deal with handle objects, which can be shared between
array and scalars? For instance:

     x = myHandleClass();
     y(2,2) = x;
     x.prop = 10;
     x.prop == y(2,2).prop;  % <== this should be true

2) how would you deal with dynamic properties?

3) it seems Matlab does not support polymorphism in array of handle
class objects; however, some people tend to think it's a shame; maybe
that would be a possible enhancement compared to Matlab

I admit that the current storage scheme is not the most efficient one,
but I think that's the one that is the easiest to use and provide the
most flexibility (because you really have "an array of object", such
each individual object keeps its entire nature).

OK, that's fine.  My guess is that object arrays are not the most
common use case anyway.  If it turns out to be important, we can look
for ways to optimize the storage later.

Thanks,

jwe


reply via email to

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