Skip to content

Commit

Permalink
Sanitize @.delete|exists to define existence as being different from …
Browse files Browse the repository at this point in the history
…default
  • Loading branch information
lizmat committed Sep 18, 2013
1 parent 5097a7b commit 710337e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions S32-setting-library/Containers.pod
Expand Up @@ -687,18 +687,17 @@ Returns the length of the array counted in elements.

=item delete

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

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

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

Returns the value(s) previously held in deleted locations.
This is considered to be an internal method. The normal way to delete is by
applying a C<:delete> adverb to any subscripting operation.

Returns the value previously held in deleted location.

=item :delete

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

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

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

Supplying a different number of indices than invocant has dimensions is
an error.
Expand Down

0 comments on commit 710337e

Please sign in to comment.