Damian Conway writes:
> Unary ~> would (by analogy to unary dot) append the current topic to the
> argument list of its operand.
>
> Thus, your examples become simply:
>
> given @list {
> ~> grep /bad!/ ~> @throw;
> ~> grep /good/ ~> @keep;
> }
>
> And:
>
> given @list {
> ~> grep length == 1 ~> @onecharthings;
> ~> grep [0..29] ~> @numberslessthan30;
> ~> grep /^\w+$/ ~> @words;
> ~> grep $_%2==0 ~> @evennumbers;
> }
>
> Damian
>
but if I dont want to force @list in scalar context ???
since ~> and friends are _pure_ grammar while given is not ,
probably we can have unary postfix ~> ( or |~> )
{
@list ~> ; # ( or @list |~> ; )
~> grep length == 1 ~> @onecharthings;
~> grep [0..29] ~> @numberslessthan30;
~> grep /^\w+$/ ~> @words;
~> grep $_%2==0 ~> @evennumbers;
}
as a way to multiplex @list
arcadi