[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question regarding code generation
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 18 Dec 2015 16:32:33 -0200
> @number[] does two things:
> If applied to a table constructor it converts the table to number[] which
> is a specialisation of the table. This is done by changing the op code from
> OP_NEWTABLE to OP_RAVI_NEWARRAYF.
> If applied to an expression that is not a constructor it generates a
> OP_RAVI_TOARRAYF instruction which will assert at runtime that the
> expression is of type number[].
In my view, the cleanest solution (but that needs more changes) would
be to introduce a new kind of expression, VCONSTRUCTOR.
-- Roberto