-
-
Save masak/082fc27b6e270d852e65 to your computer and use it in GitHub Desktop.
my change to make *-1 work in :nth
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
$ git diff | |
diff --git a/src/core/Str.pm b/src/core/Str.pm | |
index 7bfe46d..7448304 100644 | |
--- a/src/core/Str.pm | |
+++ b/src/core/Str.pm | |
@@ -621,6 +621,9 @@ my class Str does Stringy { # declared in BOOTSTRAP | |
my $max = 0; | |
while @nlist { | |
my $n = shift @nlist; | |
+ if $n ~~ WhateverCode { | |
+ $n = $n(@src + 1); | |
+ } | |
fail "Attempt to retrieve negative match :nth($n)" if $n < 1; | |
if $n > $max { take @src[$n-1]; $max = $n; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment