Zig Interface Revisited

Maybe I’m old-fashioned, but I don’t like @this sometimes hard to follow, otherwise I like your approach, it’s one of the parts I haven’t gotten into vtables yet.

Yes. @This() is distracting for reading. Sometimes when doing exploratory coding and the naming is not finalized yet, @This() helps. But once the code is settled, should have changed it back to type name.

There were some great suggestions from everyone. I’m going to write a second version. Sigh, that’s why this interface thing has so many versions; there’s always some improvements coming forward.

1 Like

I’m sorry that I overlooked the need to dynamically modify the vtable. I now believe your solution is basically the best.