logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

List::Objects::WithUtils::Role::Array::Immutable - Immutable array behavior

Author

       Jon Portnoy <avenj@cobaltirc.org>

       Licensed under the same terms as Perl.

perl v5.38.2                                       2024-03-07             List::Objects::...rray::Immutable(3pm)

Description

       This role adds immutable behavior to List::Objects::WithUtils::Role::Array consumers.

       The following methods are not available and will throw an exception:

         clear
         set
         pop push
         shift unshift
         delete delete_when
         insert
         rotate_in_place
         splice

       (The backing array is also marked read-only.)

       See List::Objects::WithUtils::Array::Immutable for a consumer implementation that also pulls in
       List::Objects::WithUtils::Role::Array & List::Objects::WithUtils::Role::Array::WithJunctions.

Name

       List::Objects::WithUtils::Role::Array::Immutable - Immutable array behavior

Synopsis

         # Via List::Objects::WithUtils::Array::Immutable ->
         use List::Objects::WithUtils 'immarray';
         my $array = immarray(qw/ a b c /);
         $array->push('d');  # dies

See Also