| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Common Methods for Operating on Scalars |
|
2
|
|
|
|
|
|
|
package Bubblegum::Object::Scalar; |
|
3
|
|
|
|
|
|
|
|
|
4
|
36
|
|
|
36
|
|
20582
|
use 5.10.0; |
|
|
36
|
|
|
|
|
109
|
|
|
|
36
|
|
|
|
|
1595
|
|
|
5
|
36
|
|
|
36
|
|
164
|
use namespace::autoclean; |
|
|
36
|
|
|
|
|
45
|
|
|
|
36
|
|
|
|
|
199
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
36
|
|
|
36
|
|
2050
|
use Bubblegum::Class 'with'; |
|
|
36
|
|
|
|
|
66
|
|
|
|
36
|
|
|
|
|
201
|
|
|
8
|
36
|
|
|
36
|
|
26983
|
use Bubblegum::Constraints -isas, -types; |
|
|
36
|
|
|
|
|
64
|
|
|
|
36
|
|
|
|
|
385
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Bubblegum::Object::Role::Output'; |
|
11
|
|
|
|
|
|
|
with 'Bubblegum::Object::Role::Value'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @ISA = (); # non-object |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.45'; # VERSION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub and { |
|
18
|
2
|
|
|
2
|
1
|
2344
|
my ($self, $other) = @_; |
|
19
|
2
|
|
66
|
|
|
12
|
return $self && $other; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub not { |
|
23
|
2
|
|
|
2
|
1
|
2539
|
my ($self) = @_; |
|
24
|
2
|
|
|
|
|
8
|
return !$self; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub or { |
|
28
|
2
|
|
|
2
|
1
|
2464
|
my ($self, $other) = @_; |
|
29
|
2
|
|
66
|
|
|
13
|
return $self || $other; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub print { |
|
33
|
2
|
|
|
2
|
1
|
2632
|
my $self = CORE::shift; |
|
34
|
2
|
|
|
|
|
9
|
return CORE::print $self, @_; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub repeat { |
|
38
|
2
|
|
|
2
|
1
|
2533
|
my $self = CORE::shift; |
|
39
|
2
|
|
|
|
|
7
|
my $number = type_number CORE::shift; |
|
40
|
2
|
|
|
|
|
429
|
return $self x $number; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub say { |
|
44
|
2
|
|
|
2
|
1
|
2503
|
my $self = CORE::shift; |
|
45
|
2
|
|
|
|
|
104
|
return print($self, @_, "\n"); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub xor { |
|
49
|
2
|
|
|
2
|
1
|
2491
|
my ($self, $other) = @_; |
|
50
|
2
|
100
|
50
|
|
|
18
|
return ($self CORE::xor $other) ? 1 : 0; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |