[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Questions about 5.2 standard library [table.unpack and rawlen]
- From: David Manura <dm.lua@...>
- Date: Tue, 4 Jan 2011 02:01:42 -0500
On Sun, Jan 2, 2011 at 2:26 PM, Greg Falcon <firstname.lastname@example.org> wrote:
> [...] table.pack() and table.unpack() aren't symmetrical [...]
That was also noted in Renato's reply to Patrick's comments in .
> [...] table.pack() might want a metatable where __len returns the larger
> of n and the raw length [to be read by table.unpack]
That would break the current practice that table.* functions ignore metamethods.
> The standard library probably needs a rawlen() function [...]
Nor is there, for that matter, rawtostring, rawipairs, and rawpairs
, although rawipairs and rawpairs (and to some extent rawlen) can
be implemented in terms of rawget and next (not called "rawnext").