[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: host-plugin interface
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 8 Feb 2010 15:38:21 +0200
On Mon, Feb 8, 2010 at 3:27 PM, Thijs Koerselman
> I guess on load I could check for certain functions to be available, and
> report an error when the interface doesn't seem to be complete, but doesn't
> feel like a very nice approach.
This is quite a respectable approach in the dynamic universe!
But, yes, there's a better way; ask the modules to export an object
factory (if that fails then it's definitely bad) and insist that these
objects all have a metatable which contains some distinct field/value.
This field can then identify the interface; the value can be made as
distinct as you like.