lua-users home
lua-l archive

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


On 2009-12-31, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Wed, Dec 30, 2009 at 12:05 PM, Philippe Lhoste <PhiLho@gmx.net> wrote:
>  > Perhaps the comment from ltable.c:
>
> [..snip..]
>
>  A map() function could easily generate lots of holes:
>
>  map(tonumber,{'10','x','20','y'})  --> {10,nil,20,nil}
>
>  [..snip..]
>  steve d.
>

I wish that "map" would convert nil to false before pushing it into
resultant array so that it becomes {10, false, 20, false} avoiding
holes and preserving the length. Within conditionals like "if",
"while" etc nil and false are equivalent.

--Leo--