Perl6::Classes

Perl6::Classes project contains first class classes in Perl 5.
Download

Perl6::Classes Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Luke Palmer
  • Publisher web site:
  • http://search.cpan.org/~lpalmer/Symbol-Opaque-0.03/lib/Symbol/Opaque.pm

Perl6::Classes Tags


Perl6::Classes Description

Perl6::Classes project contains first class classes in Perl 5. Perl6::Classes project contains first class classes in Perl 5.SYNOPSIS use Perl6::Classes; class Composer { submethod BUILD { print "Giving birth to a new composern" } method compose { print "Writing some music...n" } } class ClassicalComposer is Composer { method compose { print "Writing some muzak...n" } } class ModernComposer is Composer { submethod BUILD($) { $.length = shift } method compose() { print((map { int rand 10 } 1..$.length), "n") } has $.length; } my $beethoven = new ClassicalComposer; my $barber = new ModernComposer 4; my $mahler = ModernComposer->new(400); $beethoven->compose; # Writing some muzak... $barber->compose # 7214 compose $mahler; # 89275869347968374698756....Perl6::Classes allows the creation of (somewhat) Perl 6-style classes in Perl 5. The following features are currently supported:subs, methods, and submethods And their respective scoping rules.Attributes Which are available through the has keyword, and look like $.this.Inheritance Both single and multiple inheritance are available through the is keyword.Signatures Signatures on methods, subs, and submethods are supported, but just the Perl 5 kind.Data hiding Using the public, protected, and private traits, you can enforce (run-time) data hiding. This is not supported on attributes, which are always private.Anonymous classes That respect closures. You can now nest them inside methods of other classes, even other anonymous ones!The Perl6::Classes module augments Perl's syntax with a new declarator: class. It offers the advantage over Perl's standard OO mechanism that it is conceptually easier to see (especially for those from a C++/Java background). It offers the disadvantage, of course, of being less versatile.Requirements:· Perl Requirements: · Perl


Perl6::Classes Related Software