lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

François Perrad wrote:
[...]
> 1) numeric for with step = 0 causes infinite loop
>     $ luajit -e 'for i = 5, 7, 0 do end'

I can confirm this.

If I replace the for...do...end with the equivalent chunk of pseudocode
from section 2.4.5 of the manual, it all works as expected.

> 2) losing arguments with metamethod __call
[...]
>                      print('m.__call ' .. tostring(obj) .. ', ' ..
> table.concat(arg, ', '))

arg is a Lua 5.0-ism. Lua 5.1 has a backwards compatibility option,
which by default is turned on. LuaJIT 1 had this option which was by
default turned off --- LuaJIT 2 appears not to have it at all.

Use {...} instead of arg and it all works.

[...]
> 4) table.maxn
> 5) deprecated table.setn

Again, these are Lua 5.0-isms that are now deprecated in Lua 5.1. Use
#table instead.

- --
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "There is nothing in the world so dangerous --- and I mean *nothing*
│ --- as a children's story that happens to be true." --- Master Li Kao,
│ _The Bridge of Birds_
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK7aZHf9E0noFvlzgRAp32AJwPJcM8AESkPB7sGd3fw7s9+LoGYwCgyIru
AyzdJlejIVtYzaEMB4fWo+A=
=SaAF
-----END PGP SIGNATURE-----