lua-users home
lua-l archive

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


On Fri, Aug 1, 2014 at 11:39 AM, Xavier Wang <weasley.wx@gmail.com> wrote:

> Yes, and if do this in C API it may even better.
>
> void lua_wipetable(lua_State *L, int arraypart, int hashpart);

I do like the idea of the Lua-exposed function calling a function in
the C API so it can be used from both sides :-)  For some reason I
hadn't consciously thought about that before.  So now it comes down to
what is the least confusing name...

table.clear() -- I think this is what most people have come up with?
table.wipe() -- I do like this verb
table.drain() -- what??
table.purge() -- my favorite
table.empty() -- I like this, but it might make people think it
returns a boolean...
table.dump() -- confusing with string.dump() there...