lua-users home
lua-l archive

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


Ben Sunshine-Hill wrote:

> Why not simply tweak the compiler so that it recognizes #{...} as a
> special case, and evaluates the expression without constructing a
> table?

But then then the results of the new length operator will behave
differently in these two cases:

    function a(...)
      print(#{...})
    end

    function b(...)
      local t = {...}
      print(#t)
    end

    a(nil) ---> 1
    b(nil) ---> 0


Attachment: signature.asc
Description: OpenPGP digital signature