lua-users home
lua-l archive

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

On Thu, Nov 12, 2009 at 12:01 PM, David Given <> wrote:
>      (...) [When using Go] You can't use structs
> as map keys (I don't know about pointers).

The specification page here:

...says that both pointers and *interfaces* can be used as map key
types. Which I would assume means that a struct can be used as long as
it implements an interface that includes the comparison operators.
This kind of conflicts with the FAQ question that only says that
structs "do not" implement comparison, though:, it's rather confusing.