|
On 3/21/2012 12:19 PM, Egor Skriptunoff wrote:
local a,b,c=(''):byte(),1,2 print(a,b,c) # nil 1 2 I would've thought this should be # 1 2 nilLua reduces empty result list of (''):byte() to one value == nil.
But then type((''):byte()) bombs out that no parameter were given, and in the source code, string.byte it returns 0..n elements on the stack.
See chapter 'Expressions' in Lua Manual.
I'll take a look!
# Note the coma at the end local a,b,c=('ab'):byte(1,2), print(a,b,c) # nil nil nilIt is equivalent to local a,b,c=('ab'):byte(1,2),print(a,b,c) It prints your global a,b,c :)
LOL! Thanks for that one!