lua-users home
lua-l archive

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


> Come to think of it actually it could be a noop function - i.e. the
> function call would cause the code generator to insert type coercion
> operations but then the VM would recognise the noop function and do
> nothing. So I can imagine a function called cast() which is this magic
> noop function.
> 
> local i: integer = cast(x[1])
> 
> Would cause the code generator to emit TOINT opcode after calling the
> function cast(). But the VM would not call any function at all as it
> would recognize 'cast()' as noop.

What do you mean by "the VM" in this sentence? If the code generator can
recognize the noop funcion (so that it does not insert a call to it),
couldn't it recognize a cast function and inline it?

-- Roberto