Non-intrusive vtable

from blog lottia notes, | ↗ original
const Control = union(enum) { button: *Controls.Button, menubar: *Controls.Menubar, menu: *Controls.Menu, menu_item: *Controls.MenuItem, editor: *Controls.Editor, fn generation(self: Control) usize { return switch (self) { inline else => |c| c.generation, }; } fn setGeneration(self:...