lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Nov 11, 2010 at 09:24, steve donovan <steve.j.donovan@gmail.com> wrote:
What he suggests is that DeviceTag could be an object that supports an
equals() method, so that DeviceTag:equals 'Blender' is possible. That
method could be 'overloaded' at run-time by looking at the type of the
second argument.

Another, syntazctically terser solution would be to define your object like this:

Tag = {name = "Barabzor", ["Barabzor"] = true}

You could then test

if Tag["someName"] then dostuf() end