• Home
  • Popular Downloads
  • Contact Us
  • Submit

Softpile

Free Downloads

Main Navigation
  • Home
  • Windows
  • Mac OS X
  • Business
  • Desktop
  • Development
  • Education
  • Games
  • Internet
  • Multimedia
  • Utilities
Home » Linux » Class::C3

Class::C3

June 16, 2009
A pragma to use the C3 method resolution order algortihm
Version: 0.21
License: Perl Artistic License
Operating System: Linux
Homepage: search.cpan.org
Developed by: Florian Ragwitz
Class::C3 is a pragma to use the C3 method resolution order algortihm.

SYNOPSIS

 package A;
 use Class::C3;
 sub hello { 'A::hello' }

 package B;
 use base 'A';
 use Class::C3;

 package C;
 use base 'A';
 use Class::C3;

 sub hello { 'C::hello' }

 package D;
 use base ('B', 'C');
 use Class::C3;

 # Classic Diamond MI pattern
 # < A >
 # /
 # < B > < C >
 # /
 # < D >

 package main;

 # initializez the C3 module
 # (formerly called in INIT)
 Class::C3::initialize();

 print join ', ' => Class::C3::calculateMRO('Diamond_D') # prints D, B, C, A

 print D->hello() # prints 'C::hello' instead of the standard p5 'A::hello'

 D->can('hello')->(); # can() also works correctly
 UNIVERSAL::can('D', 'hello'); # as does UNIVERSAL::can()

This is pragma to change Perl 5's standard method resolution order from depth-first left-to-right (a.k.a - pre-order) to the more sophisticated C3 method resolution order.
algortihm c3 method order algortihm perl perl module
Free Download 30K
0
  • Share on:

Class::C3 User Reviews

Sponsored

Categories

  • Linux

Related Downloads

Proc::ParallelLoop
Parallel looping constructs for Perl programs
Bio::Tools::GuessSeqFormat
A module for determining the sequence format of the contents of a file, a ...
Astro::Coords::Calibration
Calibrations that do not have coordinates
Chart::Gnuplot
Plot graph using Gnuplot on the fly
Integrator::Test::ConfigData
Configuration information transfered in the TAP output
Copyright © 1999-2017 Softpile Free Downloads
  • Contact Us
  • Submit
  • Privacy Policy
  • Disclaimer
  • Terms of Use