Re: Table length evaluations --> Lua 5.5 vs. Lua 5.4
"'Kritzel Kratzel' via lua-l" <[email protected]>
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
Indeed:
[C:\...\tests]> lua -e "print(_VERSION); t={nil,true}; print(#t)"
Lua 5.5
0
[C:\...\tests]> lua -e "print(_VERSION); t={nil,true,true}; print(#t)"
Lua 5.5
0
[C:\...\tests]> lua -e "print(_VERSION); t={nil,true,true,true}; print(#t)"
Lua 5.5
4
[C:\...\tests]> lua -e "print(_VERSION); t={nil,true,true,true,true};
print(#t)"
Lua 5.5
5
[C:\...\tests]> lua -e "print(_VERSION); t={nil,true,true,true,true,true};
print(#t)"
Lua 5.5
6
I mean, is the the intented behavior?
Błażej Roszkowski schrieb am Sonntag, 15. Februar 2026 um 13:05:07 UTC+1:
> It seems there are still bugs. Comment in C source says "or 0 if t[1] is
> absent" but
> for {nil, 1, 1, 1} the # yields 4 (due to *lenhint being 2 so 1 is never
> checked).
>
> On Sun, 15 Feb 2026 at 12:15, 'Sainan' via lua-l <[email protected]>
> wrote:
>
>> Already discussed:
>> https://groups.google.com/g/lua-l/c/pOH68GYtDgw/m/BFAORSs5DAAJ
>>
>> -- Sainan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "lua-l" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion visit
>> https://groups.google.com/d/msgid/lua-l/-cUyh55EpmfwvcYw_VudoxV8qT60SexwLNx36uzfDGDSDOS2-GGp4Kqh0lQxxX7NARzhur1LZMlcyutRiYLuQ-KnvKOFizgH0wAA9Bks82E%3D%40calamity.inc
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/571fb932-c882-4a14-a20c-c42df6ab04adn%40googlegroups.com.