-
-
Save Mouq/4d320515a1a718a75b22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/array_slice.pm b/src/core/array_slice.pm | |
index fd36fc4..8bafa06 100644 | |
--- a/src/core/array_slice.pm | |
+++ b/src/core/array_slice.pm | |
@@ -241,4 +241,14 @@ multi sub postcircumfix:<[ ]>(\SELF, :$v!, *%other) is rw { | |
SLICE_MORE( SELF, SELF.keys, True, :$v, |%other ); | |
} | |
+# @a[;] | |
+multi sub postcircumfix:<[ ]> (\SELF is rw, LoL \keys, *%adv) is rw { | |
+ keys > 1 ?? SELF[keys[0].list].map({postcircumfix:<[ ]>($_, LoL.new(|keys[1..*]), |%adv)}).eager | |
+ !! postcircumfix:<[ ]>(SELF, keys[0].list, |%adv); | |
+} | |
+multi sub postcircumfix:<[ ]> (\SELF is rw, LoL \keys, Mu \assignee, *%adv) is rw { | |
+ keys > 1 ?? SELF[keys[0].list].map({postcircumfix:<[ ]>($_, LoL.new(|keys[1..*]), assignee, |%adv)}).eager | |
+ !! postcircumfix:<[ ]>(SELF, keys[0].list, assignee, |%adv); | |
+} | |
+ | |
# vim: ft=perl6 expandtab sw=4 | |
diff --git a/src/core/hash_slice.pm b/src/core/hash_slice.pm | |
index 592ed76..575b194 100644 | |
--- a/src/core/hash_slice.pm | |
+++ b/src/core/hash_slice.pm | |
@@ -131,4 +131,14 @@ multi sub postcircumfix:<{ }>(\SELF, :$p!, *%other) is rw { | |
SLICE_MORE( SELF, SELF.keys, False, :$p, |%other ); | |
} | |
+# %h{;} | |
+multi sub postcircumfix:<{ }> (\SELF is rw, LoL \keys, *%adv) is rw { | |
+ keys > 1 ?? SELF{keys[0].list}.map({postcircumfix:<{ }>($_, LoL.new(|keys[1..*]), |%adv)}).eager | |
+ !! postcircumfix:<{ }>(SELF, keys[0].list, |%adv); | |
+} | |
+multi sub postcircumfix:<{ }> (\SELF is rw, LoL \keys, Mu \assignee, *%adv) is rw { | |
+ keys > 1 ?? SELF{keys[0].list}.map({postcircumfix:<{ }>($_, LoL.new(|keys[1..*]), assignee, |%adv)}).eager | |
+ !! postcircumfix:<{ }>(SELF, keys[0].list, assignee, |%adv); | |
+} | |
+ | |
# vim: ft=perl6 expandtab sw=4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment