lua-users home
lua-l archive

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


varol kaptan wrote:
The # operator will work as expected only when the tables are
well-formed arrays (which means that #t == n implies that values at
indices 1 to n are NOT nil and that the value at index n+1 IS nil. In
your case the indices are actually strings (besides the fact that they
don't start at 1). The fact that you consider this to be an oddity
means that you most probably need to read the manual on this issue
very carefully.

Cheers,
Varol Kaptan
[snip original post]

Hello,

Thanks for the reply.

You are correct I didn't understand the operator only worked for arrays and not dictionaries/hashes. My bad. I understood that it only worked for well formed tables, but neglected the understanding that it was for arrays only.

As to it being an oddity. It was a question not a statement.

I was fully aware my understanding of the issue was by far the leading potential error.

Thanks for the lesson. It helps. And I do need to read the manual some more. Just trying to apply what I've learned or think I've learned in between readings.

Jimmie