Skip to content

Commit 710337e

Browse files
committed
Sanitize @.delete|exists to define existence as being different from default
1 parent 5097a7b commit 710337e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

S32-setting-library/Containers.pod

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -687,18 +687,17 @@ Returns the length of the array counted in elements.
687687

688688
=item delete
689689

690-
method delete (@array : *@indices --> List ) is export
690+
method delete (@array : Int $index --> $value ) is export
691691

692-
Sets elements specified by C<@indices> in the invocant to a
693-
non-existent state, as if they never had a value. Deleted elements at
694-
the end of an Array shorten the length of the Array, unless doing so
695-
would violate an C<is shape()> definition.
692+
Sets the specified Array element to the default value of the Array.
696693

697-
This is considered to be an internal method. The interpretation of C<@indices>
698-
is therefor subject to change. The normal way to delete is by applying a
699-
C<:delete> adverb to any subscripting operation.
694+
Deleted elements at the end of an Array shorten the length of the Array,
695+
unless doing so would violate an C<is shape()> definition.
700696

701-
Returns the value(s) previously held in deleted locations.
697+
This is considered to be an internal method. The normal way to delete is by
698+
applying a C<:delete> adverb to any subscripting operation.
699+
700+
Returns the value previously held in deleted location.
702701

703702
=item :delete
704703

@@ -709,8 +708,8 @@ returns the elements normally, but reads them out destructively.
709708

710709
method exists (@array: Int $index --> Bool )
711710

712-
True if the specified Array element has been assigned to. This
713-
is not the same as being defined.
711+
True if the specified Array element has been assigned to with a value different
712+
from the default value of the Array.
714713

715714
Supplying a different number of indices than invocant has dimensions is
716715
an error.

0 commit comments

Comments
 (0)