'Is it possible to bind a wildcard value to a variable inside a given block?
I want to do something like this in raku, the idea is that while I'm in a given
block I want to match a wildcard to a variable to use it inside the condition, is it possible?
given @my-array {
when @[*element] {
say *element;
}
when @[] {
say "nothing :(";
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|