From 710337efafa2487b58e7b41859ad0232853b4af2 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Wed, 18 Sep 2013 17:00:15 +0200 Subject: [PATCH] Sanitize @.delete|exists to define existence as being different from default --- S32-setting-library/Containers.pod | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/S32-setting-library/Containers.pod b/S32-setting-library/Containers.pod index 887170a9c..dd17b3262 100644 --- a/S32-setting-library/Containers.pod +++ b/S32-setting-library/Containers.pod @@ -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 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 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 @@ -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.