> invert the var binding: make them instance variables and it falls out
> easily:

Okay, this idea with the variable binding is pointless in this
context.
(I still would like to know if it's possible to create a local
variable
though.)

I now defined a subclass of Array with a more clever === method,
which
knows how to match wildcards. This version comes pretty close to what
I
intended.

    class Foo < MatchStruct
        fields :a, :b, :c, :d, :e
    end

    class Bar < MatchStruct
        fields :a, :b
    end

    x = Foo[1, 2, 3, 4, 5]
    a = MatchStruct(x) do
        match Foo[1, :_, 3, :_, 5] do
            ["Foo", *x]
        end
        match Bar[:_, "b"] do
            ["Bar", x.a + x.b]
        end
    end
    p a

Regards,
Thomas.