enum Direction <north east south west>;
for north, east, south, west -> $dir {
say $dir;
...
}
I don't want to repeat the list of Direction values here. How can I programmatically get this list?
I haven't found anything in the documentation. Closest is .enums, but that returns a Map of (string) key to (integer) value, not enum values.
If the order doesn't matter
or
Sorted by value
Sorted by definition; if you know first and last element
if you don't