"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/lib/RPerl/Algorithm.pm" (30 Aug 2019, 3178 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Algorithm.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.601000_vs_4.000000.

    1 # [[[ HEADER ]]]
    2 package RPerl::Algorithm;
    3 use strict;
    4 use warnings;
    5 use RPerl::AfterSubclass;
    6 our $VERSION = 0.011_000;
    7 
    8 # [[[ OO INHERITANCE ]]]
    9 use parent qw(RPerl::CompileUnit::Module::Class);    # no non-system inheritance, only inherit from base class
   10 use RPerl::CompileUnit::Module::Class;
   11 
   12 # [[[ CRITICS ]]]
   13 ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
   14 ## no critic qw(RequireInterpolationOfMetachars)  # USER DEFAULT 2: allow single-quoted control characters & sigils
   15 ## no critic qw(ProhibitConstantPragma ProhibitMagicNumbers)  # USER DEFAULT 3: allow constants
   16 ## no critic qw(Capitalization ProhibitMultiplePackages ProhibitReusedNames)  # SYSTEM DEFAULT 3: allow multiple & lower case & mixed-case package names
   17 
   18 # [[[ CONSTANTS ]]]
   19 use constant TIME_BEST    => my string $TYPED_TIME_BEST    = '<<< UNKNOWN >>>';
   20 use constant TIME_AVERAGE => my string $TYPED_TIME_AVERAGE = '<<< UNKNOWN >>>';
   21 use constant TIME_WORST   => my string $TYPED_TIME_WORST   = '<<< UNKNOWN >>>';
   22 use constant SPACE_WORST  => my string $TYPED_SPACE_WORST  = '<<< UNKNOWN >>>';
   23 
   24 # [[[ OO PROPERTIES ]]]
   25 our hashref $properties = { foo => my string $TYPED_foo = '<<< DEFAULT, ALGORITHM >>>' };
   26 
   27 # [[[ SUBROUTINES & OO METHODS ]]]
   28 
   29 # [ INHERITANCE TESTING ]
   30 
   31 sub inherited_Algorithm {
   32     { my void::method $RETURN_TYPE };
   33     ( my RPerl::Algorithm $self, my string $person ) = @ARG;
   34     RPerl::diag( 'in PERLOPS_PERLTYPES Algorithm->inherited_Algorithm(), have ::class($self) = ' . ::class($self) . ' and $person = ' . $person . ', FNORD' . "\n" );
   35     return;
   36 }
   37 
   38 sub inherited_Algorithm_foo_get {
   39     { my string::method $RETURN_TYPE };
   40     ( my RPerl::Algorithm $self ) = @ARG;
   41     RPerl::diag( 'in PERLOPS_PERLTYPES Algorithm->inherited_Algorithm_foo_get(), have ::class($self) = ' . ::class($self) . ', FNORD' . "\n" );
   42     return $self->{foo};
   43 }
   44 
   45 sub inherited_Algorithm_foo_set {
   46     { my void::method $RETURN_TYPE };
   47     ( my RPerl::Algorithm $self, my string $foo_new ) = @ARG;
   48     RPerl::diag( 'in PERLOPS_PERLTYPES Algorithm->inherited_Algorithm_foo_set(), have ::class($self) = ' . ::class($self) . ' and $foo_new = ' . $foo_new . ', FNORD' . "\n" );
   49     $self->{foo} = $foo_new;
   50     return;
   51 }
   52 
   53 #sub inherited {
   54 #    { my void::method $RETURN_TYPE };
   55 #    ( my RPerl::Algorithm $self, my string $person ) = @ARG;
   56 #    RPerl::diag('in PERLOPS_PERLTYPES Algorithm->inherited(), have ::class($self) = ' . ::class($self) . ' and $person = ' . $person . ', IS' . "\n");
   57 #    return;
   58 #}
   59 
   60 sub uninherited_Algorithm {
   61     { my string $RETURN_TYPE };
   62     ( my string $person ) = @ARG;
   63     RPerl::diag( 'in PERLOPS_PERLTYPES Algorithm::uninherited_Algorithm(), received $person = ' . $person . ', MYSTIC' . "\n" );
   64     return 'Algorithm::uninherited_Algorithm() RULES! PERLOPS_PERLTYPES';
   65 }
   66 
   67 #sub uninherited {
   68 #    { my string $RETURN_TYPE };
   69 #    ( my string $person ) = @ARG;
   70 #    RPerl::diag( 'in PERLOPS_PERLTYPES Algorithm::uninherited(), received $person = ' . $person . ', TERRITORY' . "\n" );
   71 #    return 'Algorithm::uninherited() ROCKS! PERLOPS_PERLTYPES';
   72 #}
   73 
   74 1;    # end of class