Re: hello and unpack() issue.

  • From: Christopher Oliver <current.input.port@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 10 Sep 2021 10:39:18 -0400

On Fri, 10 Sep 2021 07:25:29 -0700
Matt Gerassimoff <mgeras@xxxxxxxxx> wrote:

I guess then it is incompatibility because lua 5.1 works as I have
described.

Don't think of it as incompatibility.  You're counting on an undefined 
behaviour.
The length of an table containing nils in its indexed part is ambiguous.  I'm 
not
even sure you have a guarantee the table following the first nil isn't 
represented
as key/value pairs rather than values at an index.  If you need an indexed table
with omissions, you'll need to use 'false' for those omissions.

-- 
Christopher Oliver <current.input.port@xxxxxxxxx>

Other related posts: