[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: inherted overload & mixed type operations



On Wed, Jan 12, 2000 at 04:14:23PM -0500, Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> On Thu, Jan 13, 2000 at 10:10:10AM +1300, Christian Soeller wrote:
> > I suppose Marc's original point (which he didn't make very clear) was

I definitely didn't make it very clear, since my understanding of the
problem was very vague, and I didn't know about the bug.

I only found out when Christian gave me examples of things that do not
work, while the same example works fine when I add a "+ 5" at the end of
my expression (as in "$c = $a*$b+5", which sounds like a bug, since the
extra addition at the end shouldn't cause different calls to "*").

> This point was very clear, but I do not think multi-argument
> polymorphism should do anything with the core.  It is too complicated,
> too unintuitive, too error-prone etc to be included in general-purpose
> logic.

That's your opinion, and it is a very honorable opinion. So what you say,
in effect, is: If you want polymorphism _and_ ovwerlaoding you will get no
help from perl.

That is fine, perl cannot and does not do everything for me. My point
is just that it would be extremely handy (in this case), and extremely
logical.

What is necessary, however, is a guarantee from perl that overloaded calls
do not get chached, i.e. it must be possible to overwrite overloaded
operators from another module (e.g. PDL::Complex must overwrite PDL's
multiplication), even after objects of type PDL:: exist.

This seems to work right now (PDL does that), and makes it possible (yet
awkward) to implement this kind of polymorphism without having to change
the innards of another module.

> I will be very glad if somebody can prove me wrong (by demostrating
> dispatch logic appropriate for general consumption).

You can't prove opinions as "wrong": If you think that perl should not
have such a feature, because it is "not appropriate" and "because you
feel" that way, then there is no way to "prove" that you feel wrong!

> Please, either demostrate it with pure-Perl classes,

This seems very difficult. Some level of complexity is obviously
neceessary here.

> or produce suspicious -Do output (in contrast to other -D?, this output

You should have by know.

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@opengroup.org |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |


References to:
Marc Lehmann <marc@gimp.org>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Marc Lehmann <marc@gimp.org>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Marc Lehmann <marc@gimp.org>
Christian Soeller <c.soeller@auckland.ac.nz>
Marc Lehmann <marc@gimp.org>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Christian Soeller <c.soeller@auckland.ac.nz>
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]