in reply to Re^9: RFC: OO Perl using Moo/Moose book
in thread RFC: OO Perl using Moo/Moose book

I never claimed it would be language-agnostic. It's a Modern Perl OO book. I just hope that it can teach principles that they can apply when programming in other languages too.

  • Comment on Re^10: RFC: OO Perl using Moo/Moose book

Replies are listed 'Best First'.
Re^11: RFC: OO Perl using Moo/Moose book
by LanX (Saint) on May 01, 2019 at 11:14 UTC
    With the wrong terminology?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Wikipedia says

      The term delegation is also used loosely for various other relationships between objects; see delegation (programming) for more. Frequently confused concepts are simply using another object, more precisely referred to as consultation or aggregation; and evaluating a member on one object by evaluating the corresponding member on another object, notably in the context of the receiving object, which is more precisely referred to as forwarding (when a wrapper object doesn't pass itself to the wrapped object).12a The delegation pattern is a software design pattern for implementing delegation, though this term is also used loosely for consultation or forwarding.

      So the terminology might be considered imprecise by Wikipedia, but as that terminology and use is far from uncommon, I guess you'll have to rely on the exact definitions given by each writer instead of hoping for a general terminology.

        I saw this already.

        But if Moose claims to implement the generalized term for all "loosely" related concepts, then it should also implement the specialized core meaning.

        Did I miss a possibility to use having such that the method is called with the original $self?

        If yes please show me how. *

        It's like organizing "Pan-American Games" for Argentines and Canadians and excluding US Americans.

        > but as that terminology and use is far from uncommon

        In PHP and some other languages it's common to use "closure" synonymous for "anonymous function".

        I call this bullshit, because neither is every anno function closing over variables from an outer scope nor are named functions excluded from being closures.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        update

        To avoid misunderstandings, I prefer Forwarding over Delegation, it's much easier to handle.

        But it seems that Perl 6 is the source of this terminology, and that Moose just copied the concept.

        update

        *) does currying allow to change $self?