line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Algorithm::Inefficient; |
3
|
1
|
|
|
1
|
|
1796
|
use strict; |
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
1
|
|
50
|
|
|
1
|
|
|
|
|
7728
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
|
1
|
|
|
|
|
11509
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
41
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
5
|
1
|
|
|
1
|
|
7
|
use RPerl::AfterSubclass; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
219
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
130
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
243
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.011_000; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
1
|
|
|
1
|
|
6
|
use parent qw(RPerl::Algorithm); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
10
|
1
|
|
|
1
|
|
82
|
use RPerl::Algorithm; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
7
|
# [[[ CRITICS ]]] |
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
29
|
|
13
|
1
|
|
|
1
|
|
5
|
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
316
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
337
|
|
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
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# [[[ CONSTANTS ]]] |
18
|
1
|
|
|
1
|
|
8
|
use constant USEFULNESS => my string $TYPED_USEFULNESS = '<<< UNKNOWN >>>'; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
475
|
|
19
|
1
|
|
|
1
|
|
4981
|
|
20
|
|
|
|
|
|
|
# [[[ OO PROPERTIES ]]] |
21
|
|
|
|
|
|
|
our hashref $properties = { |
22
|
|
|
|
|
|
|
bar => my string $TYPED_bar = '<<< DEFAULT, INEFFICIENT >>>' |
23
|
|
|
|
|
|
|
}; |
24
|
1
|
|
|
1
|
0
|
825
|
|
25
|
1
|
50
|
33
|
|
|
11
|
# [[[ SUBROUTINES & OO METHODS ]]] |
26
|
0
|
|
|
|
|
0
|
|
27
|
|
|
|
|
|
|
# [ INHERITANCE TESTING ] |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our void::method $inherited__Inefficient = sub { |
30
|
0
|
0
|
|
|
|
0
|
( my RPerl::Algorithm::Inefficient $self, my string $person ) = @ARG; |
31
|
0
|
|
|
|
|
0
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient->inherited__Inefficient(), have ::class($self) = ' . ::class($self) . ' and $person = ' . $person . ', FLUFFY' . "\n" ); |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our string::method $inherited__Inefficient_bar_get = sub { |
35
|
|
|
|
|
|
|
( my RPerl::Algorithm::Inefficient $self ) = @ARG; |
36
|
1
|
|
|
|
|
5
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient->inherited__Inefficient_bar_get(), have ::class($self) = ' . ::class($self) . ', FLUFFY' . "\n" ); |
37
|
|
|
|
|
|
|
return $self->{bar}; |
38
|
|
|
|
|
|
|
}; |
39
|
1
|
50
|
|
|
|
6
|
|
40
|
|
|
|
|
|
|
our void::method $inherited__Inefficient_bar_set = sub { |
41
|
|
|
|
|
|
|
( my RPerl::Algorithm::Inefficient $self, my string $bar_new ) = @ARG; |
42
|
|
|
|
|
|
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient->inherited__Inefficient_bar_set(), have ::class($self) = ' . ::class($self) . ' and $bar_new = ' . $bar_new . ', FLUFFY' . "\n" ); |
43
|
1
|
|
|
|
|
10
|
$self->{bar} = $bar_new; |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our string::method $inherited__Inefficient_foo_get = sub { |
47
|
|
|
|
|
|
|
( my RPerl::Algorithm::Inefficient $self ) = @ARG; |
48
|
|
|
|
|
|
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient->inherited__Inefficient_foo_get(), have ::class($self) = ' . ::class($self) . ', FLUFFY' . "\n" ); |
49
|
|
|
|
|
|
|
return $self->{foo}; |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our void::method $inherited__Inefficient_foo_set = sub { |
53
|
1
|
|
|
|
|
9
|
( my RPerl::Algorithm::Inefficient $self, my string $foo_new ) = @ARG; |
54
|
1
|
|
|
|
|
6
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient->inherited__Inefficient_foo_set(), have ::class($self) = ' . ::class($self) . ' and $foo_new = ' . $foo_new . ', FLUFFY' . "\n" ); |
55
|
|
|
|
|
|
|
$self->{foo} = $foo_new; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
1
|
50
|
|
1
|
|
11
|
our void::method $inherited = sub { |
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
45
|
|
|
1
|
|
|
1
|
|
10
|
|
|
1
|
|
|
1
|
|
12
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
150
|
|
59
|
2
|
50
|
|
|
|
51
|
( my RPerl::Algorithm::Inefficient $self, my string $person ) = @ARG; |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
RPerl::diag('in PERLOPS_PERLTYPES Inefficient->inherited(), have ::class($self) = ' . ::class($self) . ' and $person = ' . $person . ', INCOMPATIBLE' . "\n"); |
61
|
|
|
|
|
|
|
}; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# all of the following happen before the INIT block, and thus rely upon AUTOLOAD |
64
|
|
|
|
|
|
|
#RPerl::diag("WAZZUP FROM Inefficient.pm\n"); |
65
|
|
|
|
|
|
|
#inherited('FAKESELF', "Spidey"); |
66
|
1
|
|
|
1
|
|
8
|
#RPerl::Algorithm::Inefficient::inherited("FAKECLASS", "Peter Parker"); |
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
55
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
74
|
|
67
|
|
|
|
|
|
|
#RPerl::Algorithm::Inefficient->inherited("Mary Jane"); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# pre-INIT AUTOLOAD resolution below only works with Perl, not Inline::CPP |
70
|
|
|
|
|
|
|
#uninherited('Doc Oc'); |
71
|
1
|
|
|
1
|
|
5
|
#RPerl::Algorithm::Inefficient::uninherited("Doctor Octavius"); |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
72
|
|
|
|
|
|
|
#RPerl::Algorithm::Inefficient->uninherited("Mad Scientist"); # ignores "Mad Scientist" |
73
|
|
|
|
|
|
|
#RPerl::diag("LATERZ FROM Inefficient.pm\n"); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
our string $uninherited__Inefficient = sub { |
76
|
|
|
|
|
|
|
( my string $person ) = @ARG; |
77
|
|
|
|
|
|
|
RPerl::diag( 'in PERLOPS_PERLTYPES Inefficient::uninherited__Inefficient(), received $person = ' . $person . ', MESSY' . "\n" ); |
78
|
|
|
|
|
|
|
return 'Inefficient::uninherited__Inefficient() RULES! PERLOPS_PERLTYPES'; |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# DEV NOTE, CORRELATION #rp004: inheritance testing, manually enable uninherited() in exactly one of Algorithm.*, Inefficient.*, Sort.*, or Bubble.* |
82
|
|
|
|
|
|
|
#our string $uninherited = sub { |
83
|
|
|
|
|
|
|
# ( my string $person ) = @ARG; |
84
|
|
|
|
|
|
|
# RPerl::diag('in PERLOPS_PERLTYPES Inefficient::uninherited(), received $person = ' . $person . ', TRICKS' . "\n"); |
85
|
|
|
|
|
|
|
# return 'Inefficient::uninherited() ROCKS! PERLOPS_PERLTYPES'; |
86
|
|
|
|
|
|
|
#}; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; # end of class |