in reply to Re^2: Using perl 6 roles in perl 5
in thread Using perl 6 roles in perl 5

But how else do we ever learn?

By improving on the current systems, not by rewriting them. Take a look at the code for Perl6::Roles. For the most part, it's just syntactic sugar. Class::Trait is more involved, but it's still just sugar, at its heart.

If there's a feature you want or a performance benchmark you feel you need to hit, write a failing test and give it to the author. That way, everyone benefits from what you're trying to do.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^4: Using perl 6 roles in perl 5
by clinton (Priest) on Jan 18, 2006 at 18:44 UTC
    You're right.

    I now need to write another class which inherits the caching but not the database interface functionality from my base classes, and suddenly roles seem like a really really good idea.

    And using a contained module seems like a much better idea than the few lines of code which did the job just 2 hours ago.

    By improving on the current systems, not by rewriting them.
    Out of interest, why did you rewrite Perl6::Role when Class::Role already existed?
      It was in response to tbunce's request for a different roles implementation so that DBIv2 could move forward. The feature needed was run-time composition which creates a new class.

      For the record, I wrote Perl6::Roles with the help/support of the authors of the other three roles implementations on CPAN at the time.


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?