line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Statistics::R::REXP::List; |
2
|
|
|
|
|
|
|
# ABSTRACT: an R generic vector (list) |
3
|
|
|
|
|
|
|
$Statistics::R::REXP::List::VERSION = '1.0'; |
4
|
22
|
|
|
22
|
|
36652
|
use 5.010; |
|
22
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
22
|
|
|
22
|
|
77
|
use Scalar::Util qw(blessed weaken); |
|
22
|
|
|
|
|
18
|
|
|
22
|
|
|
|
|
970
|
|
7
|
|
|
|
|
|
|
|
8
|
22
|
|
|
22
|
|
948
|
use Class::Tiny::Antlers; |
|
22
|
|
|
|
|
8043
|
|
|
22
|
|
|
|
|
130
|
|
9
|
22
|
|
|
22
|
|
2916
|
use namespace::clean; |
|
22
|
|
|
|
|
19957
|
|
|
22
|
|
|
|
|
91
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'Statistics::R::REXP::Vector'; |
12
|
22
|
|
|
22
|
|
6339
|
use overload; |
|
22
|
|
|
|
|
2888
|
|
|
22
|
|
|
|
|
108
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
22
|
|
|
22
|
|
744
|
use constant sexptype => 'VECSXP'; |
|
22
|
|
|
|
|
26
|
|
|
22
|
|
|
|
|
5319
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _to_s { |
18
|
278
|
|
|
278
|
|
268
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
278
|
|
|
|
|
254
|
my ($u, $unfold); |
21
|
|
|
|
|
|
|
$u = $unfold = sub { |
22
|
293
|
|
|
293
|
|
1171
|
join(', ', map { ref $_ eq ref [] ? |
23
|
696
|
100
|
|
|
|
2390
|
'[' . &$unfold(@{$_}) . ']' : |
|
15
|
100
|
|
|
|
39
|
|
24
|
|
|
|
|
|
|
(defined $_? $_ : 'undef') } @_); |
25
|
278
|
|
|
|
|
822
|
}; |
26
|
278
|
|
|
|
|
533
|
weaken $unfold; |
27
|
278
|
|
|
|
|
524
|
$self->_type . '(' . &$unfold(@{$self->elements}) . ')'; |
|
278
|
|
|
|
|
4626
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub to_pl { |
32
|
6
|
|
|
6
|
1
|
899
|
my $self = shift; |
33
|
|
|
|
|
|
|
[ map { |
34
|
16
|
100
|
66
|
|
|
82
|
if (blessed $_ && $_->can('to_pl')) { |
35
|
6
|
|
|
|
|
13
|
my $x = $_->to_pl; |
36
|
6
|
50
|
|
|
|
14
|
if (ref $x eq ref []) { |
37
|
6
|
100
|
66
|
|
|
4
|
unless (scalar @{$x} > 1 || |
38
|
|
|
|
|
|
|
$_->isa('Statistics::R::REXP::List')) { |
39
|
4
|
|
|
|
|
11
|
@{$x} |
|
4
|
|
|
|
|
13
|
|
40
|
|
|
|
|
|
|
} else { |
41
|
2
|
|
|
|
|
4
|
$x |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} else { |
44
|
0
|
|
|
|
|
0
|
$x |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} else { |
47
|
10
|
|
|
|
|
28
|
$_ |
48
|
|
|
|
|
|
|
} |
49
|
6
|
|
|
|
|
7
|
} @{$self->elements} ] |
|
6
|
|
|
|
|
126
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
234
|
|
|
234
|
|
434
|
sub _type { 'list'; } |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; # End of Statistics::R::REXP::List |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |