lua-users home
lua-l archive

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


It was thus said that the Great Jose Torre-Bueno once stated:
> 
> On Jul 6, 2013, at 9:37 AM, Tim Hill <drtimhill@gmail.com> wrote:  this
> entire model is to my mind elegant, cunning, and minimalist (all good
> qualities).
> 
> I agree that the elegance is not to be lightly discarded.  In this
> discussion I am not understanding what is wrong with using nan as a place
> holder to make a table have array like properties.  To my mind another
> advantage of nan is that string.format will not choke on it the way it
> does on nil.

  It does not, but what it does print is unexpected:

[spc]lucy:~/source/6809/simp>lua
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> x = 0/0
> print(x)
nan
> print(string.format("one %d two",x))
one -2147483648 two

  -spc (Honestly did not expect that)