in reply to Re^2: "use base" or @ISA
in thread "use base" or @ISA

My module does NOT have an ISA relationship with Exporter!

Really? So, how would you explain the relationship? Your module exports; it is an exporter.

I would say that the module "delegates to Exporter", or "uses Exporter".

Delegation and composition are perfectly valid implementation mechanisms, and there's no reason to view inheritance as the one true way of sharing functionality.

Replies are listed 'Best First'.
Re^4: "use base" or @ISA
by TimToady (Parson) on Aug 18, 2004 at 03:02 UTC
    In Perl 6 terms, it "does" Exporter rather than "is" Exporter. That is, Exporter is a role rather than a class. (It's a form of composition, really.) The Exporter role in Perl 6 would presumably supply importation as a submethod rather than a method, so that it's not inherited by subclasses.

    It could also be done with delegation, but in that case it "has" an Exporter object.

    Of course, Perl 6 might not use an Exporter class or role at all, since the standard export mechanism will be built in, and (we hope) fast.

      I suspect Dallas.pm has already been written... (or whatever extension Perl6 roles use, or, in this case "roll"s)

      (If not, someone notify the DFW monks.)

      - tye