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
# https://docs.raku.org/language/typesystem#subset | |
# A subset gives us a thing we can smartmatch ( ~~ ) against | |
# at which point the where condition gets executed on the thing we | |
# are smartmatching. | |
# | |
# For example: | |
# subset StartsWithA of Str where *.starts-with("A"); | |
# say "Brussels Sprouts" ~~ StartsWithA; # False | |
# say "Antonio Banderas" ~~ StartsWithA; # True | |
# |