lua-users home
lua-l archive

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


On 1 July 2016 at 04:37, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Fri, Jul 1, 2016 at 9:32 AM, Philipp Janda <siffiejoe@gmx.net> wrote:
>> I'm not sure what Hisham expects, but I think it would be awkward if the OO
>> syntax only worked on the arrays returned by `table.pack()` ...
>
> I should reference these things better - Hisham already thought that
> pack()/unpack() was symmetrical. And if someone of his experience
> expects this, then yes, this is a issue.

My post here about this surprise was true, but also meant to be
illustrative, hoping to see if others would be caught off-guard as me.
For the record, after I posted it, I checked the code of the recent
module I wrote that had several uses of unpack(); in most of them the
tables I was unpacking would never contain nils; in some uses I was
setting the unpack limits explicitly, but in one of them the lack of
explicit limits was an actual bug.

Amusingly, I was told off-list by another Lua user (who's more
experienced than me) that after reading my post they went "oh-oh" and
double-checked their own code as well. :)

So if _that_ user thought that pack()/unpack() was symmetrical, then I
say yes, this is an issue. :)

-- Hisham