Another possible wart in the PDL operator overloading is that the
overloaded functions are done as &PDL::operation and not 'operation'
strings which could be resolved and a method or overridden in the
subclass. I don't know if that is relevant to the OO implementation using
"has a" in place of "is a".
--Chris
On Wed, Oct 26, 2016 at 3:00 PM, Chris Marshall <devel.chm...@gmail.com>
wrote:
> I believe that the approach for PDL::NextGen core using the C Object
> System (COS) could address this problem: the operations being overloaded
> would then be multimethods so a combined operation between PDL and MyPDL
> could choose to use the operator implemented by MyPDL which, presumably
> would not have the problem with initialize().
>
> Class::MultiMethods is old but it seems enough is there to test out the
> multimethod overload resolution from perl if you were interested. For
> PDL::NextGen, as mentioned, this would be in the core PDL functions which
> would be C/XS callable from perl.
>
> --Chris
>
>
> On Wed, Oct 26, 2016 at 2:25 PM, Diab Jerius <djer...@cfa.harvard.edu>
> wrote:
>
>> Looks interesting, but not well maintained; neither of the two issues
>> reported had
>> a reply.
>>
>>
>>
>> On Tue, Oct 25, 2016 at 1:55 PM, Chris Marshall <devel.chm...@gmail.com>
>> wrote:
>> > You might take a look at
>> > http://search.cpan.org/~dconway/Class-Multimethods-1.70/ which does a
>> > perl-level implementation of multimethods. Does this resolve these
>> overload
>> > issues? (For what it is worth, the C Object System, COS, support
>> > multimethod resolution and so using it for PDL::NextGen might avoid or
>> > mitigate this problem...)
>> >
>> > --Chris
>> >
>> >
>> >
>> > On Tue, Oct 25, 2016 at 10:30 AM, Chris Marshall <
>> devel.chm...@gmail.com>
>> > wrote:
>> >>
>> >> On re-reading, I think the problem we're really discussing here is
>> >> the operator overloading and the difficulty seems to be because the
>> >> overload resolution doesn't handle selection between two classes.
>> >>
>> >> It is this that "forces" the result to be PDL or MyPDL. I'm not sure
>> >> a real solution is possible save implementing overload using
>> >> multi-methods.
>> >>
>> >> --Chris
>> >>
>> >>
>> >> On Mon, Oct 24, 2016 at 1:30 PM, Chris Marshall <
>> devel.chm...@gmail.com>
>> >> wrote:
>> >>>
>> >>> Thanks for the additional clarification for context---what a mess!
>> >>>
>> >>> From your example, it seems that the current PDL approach for OO via
>> >>> "has-a" doesn't work but my question is what method would work? Is
>> there an
>> >>> example of an OO language or framework that can be shown to work for
>> this
>> >>> type of problem? Is the problem with PDL, perl5, both, neither?
>> >>>
>> >>> --Chris
>> >>>
>> >>>
>> >>> On Mon, Oct 24, 2016 at 12:51 PM, Diab Jerius <
>> djer...@cfa.harvard.edu>
>> >>> wrote:
>> >>>>
>> >>>> On Mon, Oct 24, 2016 at 12:43 PM, Diab Jerius <
>> djer...@cfa.harvard.edu>
>> >>>> wrote:
>> >>>> > initialize() currently must assume that object construction can be
>> >>>> > done without any arguments to the constructor. That's
>> inappropriate
>> >>>> > in some instances (as described above).
>> >>>>
>> >>>> And once more, to clarify...
>> >>>>
>> >>>> initialize() is not passed any context, so must assume that object
>> >>>> attributes have defaults which are context independent. This is not
>> >>>> always appropriate.
>> >>>
>> >>>
>> >>
>> >
>>
>
>
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel