Hacker News new | ask | show | jobs
by anonymoushn 3307 days ago
Over here it generated

  local b
  do
    local _accum_0 = { }
    local _len_0 = 1
    for k, v in pairs({
      1,
      2,
      3,
      4
    }) do
      _accum_0[_len_0] = v * 2
      _len_0 = _len_0 + 1
    end
    b = _accum_0
  end
It did a pretty good job. Unlike your code, it doesn't have any function calls, and unlike the code I would probably write, it doesn't use the # operator.