lua-users home
lua-l archive

Re: table.border and lua_border in Lua 5.4?

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


On 2018年04月03日 11:18 AM, Gé Weijers wrote:
On Sat, Mar 31, 2018 at 12:44 AM, Dirk Laurie <dirk.laurie@gmail.com <mailto:dirk.laurie@gmail.com>> wrote:
 The border function is already beautifully documented, but not named,
 in the manual. However, it is hidden by the __len metamethod, and in
 particular cannot be called by that metamethod. It would be nice to
 have it exposed, and `table.border` seems like a natural place for it.
 To achieve that while conforming to the custom that the libraries use
 only lualib.h and lauxlib.h, one would need `int lua_border(lua_State
 *L, int index)`.
What about 'rawlen' and the C function 'lua_rawlen'? They ignore the __len metamethod.
--
--
Gé
What about a table.border that respects __index?
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.

AltStyle によって変換されたページ (->オリジナル) /