Compare a list of strings

In Raku, putting square brackets around an infixarrow-up-right operator turns it into a listop that effectively works as if the operator had been but in between all of the elements of the argument list (or in technical terms, it folds/reducesarrow-up-right the list using that operator, while taking into account the operator's inherent associativityarrow-up-right and identity value):

[eq] @strings  # All equal
[lt] @strings  # Strictly ascending

Last updated

Was this helpful?