lua-users home
lua-l archive

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



云风 Cloud Wu <cloudwu@gmail.com>于2018年1月9日 周二上午9:55写道:
Roberto Ierusalimschy <roberto@inf.puc-rio.br>于2018年1月8日周一 下午8:36写道:
vararg functions in critical paths often. Several (most?) vararg functions
have to create tables (or pay the price of 'select') anyway.

Can this one avoid vararg create tables in lua 5.4 ? 

function  print_with_tag(tag)
  return function(...)
    return print(tag, ...)
  end
end

No. It have _ARG tables create when each time the inner function called. ... will be compiled as a bytecode based unpack.
--
regards,
Xavier Wang.