(no title)
herrosheep | 7 years ago
my @menu = <hamburger fries milkshake>;
say @menu.contains('hamburger'); # True
say @menu.contains('hot dog'); # False
say @menu.contains('milk'); # True!
say @menu.contains('er fr'); # True!
say @menu.contains(<es mi>); # True!
xisukar|7 years ago
---
I'm not sure if I'm missing something in the "odd design choices" in this specific case so it'd be great if you could elaborate a little bit further here.
lizmat|7 years ago
raiph|7 years ago
b2gills|7 years ago
It should have used a different word.
A similar example would be the word `length`.
There is no `length` in Perl 6 because it is ambiguous. Instead there is `.elems` and `.chars`.
It is perhaps even a worse because there are other languages which use `contains` to see if the container has a given element.