Created
June 15, 2022 11:53
-
-
Save FCO/088dd067dcce838111b4d95c5328d56e 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
multi trait_mod:<is>(Routine $ref, Bool :$path-checked) { | |
$ref.wrap: -> $path, |c { | |
do if $path.starts-with: "bla/" { | |
callwith "other/path", |c | |
} else { | |
callsame | |
} | |
} | |
} | |
sub do-something-with-path($path) is path-checked { | |
say $path | |
} | |
sub do-something-else-with-path($path) is path-checked { | |
say " something else: ", $path | |
} | |
do-something-with-path "bla/ble"; | |
do-something-with-path "ble/bli"; | |
do-something-else-with-path "bla/ble"; | |
do-something-else-with-path "ble/bli" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment