lua-users home
lua-l archive

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


On Tue, Oct 6, 2015 at 12:59 PM, Coda Highland <chighland@gmail.com> wrote:
> If you're worried about a collision with some future PUC-Rio extension
> to the language, then call it "serialize_json" or something instead of
> using __ as a prefix. It can still be stored in the same place on the
> metatable.
>
> /s/ Adam

I don't have a sense that this could be turned into a new metamethod
for 5.4. It's just a solution that has worked well for me and has
persisted to work well and not smell... yet.

I think that it would be useful in a library like luaproc, which could
specify the expected behavior of such a method and provide a default
__serialize methods  that would probably work for most cases.

-Andrew