Created
January 1, 2020 09:48
-
-
Save Whateverable/43bafac6a76002f4597858f708bc7929 to your computer and use it in GitHub Desktop.
evalable6
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
my $code = 「DateTime.new("2020-01-01T10:00:00").later(:5seconds-on-mars)」; my @wild-guesses = gather { for $code ~~ m:ex/^ (.+) ‘.’ (<[\w-]>+) [ [‘: ’ (.*)] | [‘(’ (.*) ‘)’]? ] $/ -> $/ { take 「(%s).^can(‘%s’).map(*.cando(\((%s), |\(%s)))).first(*.so)[0]」.sprintf: $0, $1, $0, $2 // $3 // ‘’ } }; .say for @wild-guesses |
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
(DateTime.new("2020-01-01T10:00:00")).^can(‘later’).map(*.cando(\((DateTime.new("2020-01-01T10:00:00")), |\(:5seconds-on-mars)))).first(*.so)[0] | |
(DateTime).^can(‘new’).map(*.cando(\((DateTime), |\("2020-01-01T10:00:00").later(:5seconds-on-mars)))).first(*.so)[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment