[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Q&A with Roberto on Workshop 2012
- From: "Pierre Chapuis" <catwell@...>
- Date: Fri, 30 Nov 2012 18:27:39 +0100
> There's a standard way to attach metadata to tables, and it's to put them
> in metatables. Add a meta-field for whatever information you need, write
> predicates isarray() / ishash() which abstract implementation details
> away, and you're done.
Hmm, I guess we could do that and allow the user to pass those methods
to the libraries. It is a bit convoluted but LuaJSON does that:
https://github.com/harningt/luajson/blob/master/lua/json/encode/array.lua#L31
Thank you for the suggestion. I hope library authors will follow it now :)
--
Pierre Chapuis