Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added usage statements to Array.pod
  • Loading branch information
dha committed Oct 2, 2015
1 parent 81278cc commit 7fb82bf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/Type/Array.pod
Expand Up @@ -13,9 +13,16 @@ scalar containers, which means you can assign to array elements.
=head2 routine pop
Defined as:
multi sub pop(Array:D )
multi method pop(Array:D:)
Usage:
pop ARRAY
ARRAY.pop
Removes and returns the last item from the array. Fails for an empty array.
Example:
Expand All @@ -31,9 +38,17 @@ Example:
=head2 routine push
Defined as:
multi sub push(Array:D, *@values) returns Array:D
multi method push(Array:D: *@values) returns Array:D
Usage:
push ARRAY, VALUES
ARRAY.push(VALUES)
ARRAY.push: VALUES
Adds the C<@values> to the end of the array, and returns the modified list.
Fails for infinite arrays.
Expand All @@ -45,9 +60,16 @@ Example:
=head2 routine shift
Defined as:
multi sub shift(Array:D )
multi method shift(Array:D:)
Usage:
shift ARRAY
ARRAY.shift
Removes and returns the first item from the array. Fails for an empty arrays.
Example:
Expand All @@ -59,9 +81,17 @@ Example:
=head2 routine unshift
Defined as:
multi sub unshift(Array:D, *@values) returns Array:D
multi method unshift(Array:D: *@values) returns Array:D
Usage:
unshift ARRAY, VALUES
ARRAY.unshift(VALUES)
ARRAY.unshift: VALUES
Adds the C<@values> to the start of the array, and returns the modified array.
Fails if C<@values> is infinite.
Expand Down

0 comments on commit 7fb82bf

Please sign in to comment.