| 1 | package List::Objects::WithUtils::Array::Immutable::Typed; | ||
| 2 | 92 | $List::Objects::WithUtils::Array::Immutable::Typed::VERSION = '2.028002'; | |
| 3 | 98 | ▶ | use strictures 2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 92 | require Role::Tiny; | |
| 6 | 92 | 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::Typed | ||
| 11 | List::Objects::WithUtils::Role::Array::Immutable | ||
| 12 | /, | ||
| 13 | ); | ||
| 14 | |||
| 15 | 98 | ▶ | use Exporter (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 92 | our @EXPORT = 'immarray_of'; | |
| 17 | |||
| 18 | sub import { | ||
| 19 | 92 | ▶ | my $pkg = caller; |
|
Subroutine
import: called CC=1 SCAR=0.0
| |||
| 20 | 98 | ▶ | { no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 92 | ${"${pkg}::a"} = ${"${pkg}::a"}; | |
| 22 | 92 | ${"${pkg}::b"} = ${"${pkg}::b"}; | |
| 23 | } | ||
| 24 | 92 | goto &Exporter::import | |
| 25 | } | ||
| 26 | |||
| 27 | 0 | ▶ | sub immarray_of { __PACKAGE__->new(@_) } |
|
Subroutine
immarray_of: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 28 | |||
| 29 | 92 | 1; | |
| 30 | |||
| 31 | =pod | ||
| 32 | |||
| 33 | =for Pod::Coverage immarray_of | ||
| 34 | |||
| 35 | =head1 NAME | ||
| 36 | |||
| 37 | List::Objects::WithUtils::Array::Immutable::Typed - Immutable typed arrays | ||
| 38 | |||
| 39 | =head1 SYNOPSIS | ||
| 40 | |||
| 41 | use List::Objects::WithUtils 'immarray_of'; | ||
| 42 | use Types::Standard -types; | ||
| 43 | my $array = immarray_of( Int() => 1, 2, 3 ); | ||
| 44 | |||
| 45 | =head1 DESCRIPTION | ||
| 46 | |||
| 47 | These are immutable type-checking array objects, essentially a combination of | ||
| 48 | L<List::Objects::WithUtils::Array::Typed> and | ||
| 49 | L<List::Objects::WithUtils::Array::Immutable>. | ||
| 50 | |||
| 51 | Type-checking is performed when the object is created; attempts to modify the | ||
| 52 | object will throw an exception. | ||
| 53 | |||
| 54 | This class consumes the following roles, which contain most of the relevant | ||
| 55 | documentation: | ||
| 56 | |||
| 57 | L<List::Objects::WithUtils::Role::Array> | ||
| 58 | |||
| 59 | L<List::Objects::WithUtils::Role::Array::WithJunctions> | ||
| 60 | |||
| 61 | L<List::Objects::WithUtils::Role::Array::Typed> | ||
| 62 | |||
| 63 | L<List::Objects::WithUtils::Role::Array::Immutable> | ||
| 64 | |||
| 65 | =head1 AUTHOR | ||
| 66 | |||
| 67 | Jon Portnoy <avenj@cobaltirc.org> | ||
| 68 | |||
| 69 | =cut | ||