lua-users home
lua-l archive

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


On Monday 21 February 2011 10:38:01 Axel Kittenberger wrote:
> > But the Lua way is to show the test for NaN explicitly your code.
> > http://snippets.luacode.org/snippets/Test_for_NaN_75
> 
> Would it be too much compatibility breaking or performance impacting
> to have NaN evaluate itself to boolean false instead of true by
> default?
> 
> This would a) make NaN checking much easier, arithmetic operations
> dont return 'nil' or 'false' anyway. b) NaN could be a wonderful
> dropin for people wanting to say 'isset but nil' in a
> first-class-value-way for tables/lists.
> 
> Kind regards, Axel

Wouldn't that break existing code that assumes only false and nil are false?

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt