lua-users home
lua-l archive

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


"A sequence in Lua has no holes and # returns the number of elements in a sequence."


Does not the example below contradict the statement above? If not, then why not?



Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> a={'a','b','c','d'}
> print(#a)
4
> for k,v in ipairs(a) do print(k,v) end
1       a
2       b
3       c
4       d
> a[3]=nil
> print(#a)
4
> for k,v in ipairs(a) do print(k,v) end
1       a
2       b
>

______________________________________________________________________
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading and archival by Watlow. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Watlow accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Watlow.