Acme-Playpen
view release on metacpan or search on metacpan
lib/Tupelo/Munge.pm view on Meta::CPAN
sequence of slot values with a different one. A tuple can be marked as
read-only to prevent any mutation. A tuple thus being immutable only
prevents mutation of the tuple's sequence of slot values (and blessing
of the tuple); it doesn't affect mutation of the objects referenced by
the tuple.
It is possible for mutation to change the number of slots in a tuple,
but this is a relatively expensive operation that should be avoided.
Other than writing to a single slot and replacement of the complete
sequence of slot values, tuples do not naturally support operations to
edit the slot value sequence, such as adding an object reference onto
the end of a tuple. Such an operation can be constructed via complete
replacement of a tuple's slot value sequence, but if the desire to do
that arises then it suggests that an array would be a more appropriate
data structure.
A tuple can be identified as such through the
L<C<builtin::reftype>|builtin/reftype> function, which will return
C<OBJECT> when given a reference to one. Correspondingly, the
L<C<ref>|perlfunc/ref> function will return C<OBJECT> if given a reference
to an unblessed tuple, and the default stringification of a reference to a
( run in 0.406 second using v1.01-cache-2.11-cpan-de7293f3b23 )