@match alternative catchall

I’d like to use @match within @chain @rtransform, but both the MLStyle and Match versions use _ as the catchall which causes an error as its used by @chain.

Is there an alternative catchall in any @match package?

@chain begin

    DataFrame(A =1:2)

    @rtransform :x = @Match.match :A  begin
            1 => 10
            2 => 20
            _ => 30    #causes fail
        end

end
1 Like

In MLStyle _ is just a convention, you can use anything.

how?

Just replace _ with any other name like foo. A communicative name like default would be ok.

1 Like

thanks