lua-users home
lua-l archive

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

Thank you, guys.
It seems the Serial-Tool used by me send error string to the Lua-Interpreter.
When a string I typed contained '^', the Serial-Tool just sent the characters before '^'.
So, it is NOT a bug/err of lua.

Luiz Henrique de Figueiredo <> 于2020年7月13日周一 下午8:45写道:
> "2^2" have NOT went into OP_TAILCALL, and also OP_POW.
> So strange...

"2^2" is computed at compile time because it's a constant _expression_.
"return 2^2" gives this bytecode:

LOADF           0 4
RETURN          0 2 1   ; 1 out
RETURN          0 1 1   ; 0 out

which matches your report except that you had LOADI instead of LOADF.