aboutsummaryrefslogtreecommitdiff
path: root/lib/mergehash.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mergehash.pm6')
-rw-r--r--lib/mergehash.pm616
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/mergehash.pm6 b/lib/mergehash.pm6
index 1db7e60..db3d016 100644
--- a/lib/mergehash.pm6
+++ b/lib/mergehash.pm6
@@ -1,11 +1,15 @@
use MONKEY;
augment class Hash {
- #|Merges one a second hash into the hash the method is called on
- #|Traverses the full tree, replacing items in the original hash with the
- #|hash given in the argument. Does not replace positional elements by default,
- #|and instead appends the items from the supplied hash's array to the original
- #| hash's array. Use :no-append-array to replace arrays and positionals instead
- #|The object type of positionals is not retained and instead becomes an Array type
+ #| Merges a second hash into the hash the method is called on. Hash given as
+ #| the argument is not modified.
+ #| Traverses the full tree, replacing items in the original hash with the
+ #| hash given in the argument. Does not replace positional elements by default,
+ #| and instead appends the items from the supplied hash's array to the original
+ #| hash's array. The object type of positionals is not retained and instead
+ #| becomes an Array type.
+ #| Use :no-append-array to replace arrays and positionals instead, which will
+ #| also retain the original type and not convert to an Array
+ #|
method merge (%b; Bool:D :$no-append-array = False) {
hashmerge self, %b, :$no-append-array;
}