[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tostring() and the "not even nil" type.
- From: Romulo <romuloab@...>
- Date: Thu, 29 Apr 2010 16:40:29 -0300
> A partial solution is to append "or nil" to the argument of every
> risky tostring() call, but it would be more elegant if it were handled
> at the language level.
Also, "false" would be transformed to "nil":
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> =tostring( false or nil )
nil
Perhaps an extra parenthesis would work best:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> a=function()end
> =tostring( (a()) )
nil
>
--rb