line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package List::Objects::WithUtils::Array::Immutable; |
2
|
|
|
|
|
|
|
$List::Objects::WithUtils::Array::Immutable::VERSION = '2.028002'; |
3
|
99
|
|
|
99
|
|
1059
|
use strictures 2; |
|
99
|
|
|
|
|
548
|
|
|
99
|
|
|
|
|
3438
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require Role::Tiny; |
6
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_package( __PACKAGE__, |
7
|
|
|
|
|
|
|
qw/ |
8
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array |
9
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array::WithJunctions |
10
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array::Immutable |
11
|
|
|
|
|
|
|
/, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
99
|
|
|
99
|
|
15929
|
use Exporter (); |
|
99
|
|
|
|
|
124
|
|
|
99
|
|
|
|
|
4131
|
|
15
|
|
|
|
|
|
|
our @EXPORT = 'immarray'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
99
|
|
|
99
|
|
187
|
my $pkg = caller; |
19
|
99
|
|
|
99
|
|
622
|
{ no strict 'refs'; |
|
99
|
|
|
|
|
126
|
|
|
99
|
|
|
|
|
11321
|
|
|
99
|
|
|
|
|
108
|
|
20
|
99
|
|
|
|
|
302
|
${"${pkg}::a"} = ${"${pkg}::a"}; |
|
99
|
|
|
|
|
169
|
|
|
99
|
|
|
|
|
264
|
|
21
|
99
|
|
|
|
|
96
|
${"${pkg}::b"} = ${"${pkg}::b"}; |
|
99
|
|
|
|
|
159
|
|
|
99
|
|
|
|
|
173
|
|
22
|
|
|
|
|
|
|
} |
23
|
99
|
|
|
|
|
5294
|
goto &Exporter::import |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
7
|
|
|
7
|
1
|
1351
|
sub immarray { __PACKAGE__->new(@_) } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
List::Objects::WithUtils::Array::Immutable - Immutable array objects |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
use List::Objects::WithUtils 'immarray'; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $array = immarray(qw/ a b c /); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my ($head, $rest) = $array->head; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
These are immutable array objects; attempting to call list-mutating methods |
47
|
|
|
|
|
|
|
(or modify the backing array directly) will throw an exception. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This class consumes the following roles, which contain most of the relevant |
50
|
|
|
|
|
|
|
documentation: |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
L |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
L |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
(See L for a mutable implementation.) |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 immarray |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Creates a new immutable array object. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Jon Portnoy |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Licensed under the same terms as Perl. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |