lua-users home
lua-l archive

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


>     - upvalues in Lua are deprecated. You can prepare your programs by
>     making sure all upvalues you use are constant local variables. A
simple
>     and always correct way to do that is to introduce an extra variable
for
>     each upvalue:
>
>     old:   function () ... %x ... end
>     new:   local _x = x; function () ... %_x ... end
>
>     This does not change the meaning of your program in Lua 4.0, and will
>     keep that meaning in the new version. (Either you just remove all '%',
>     or you can use a compile-time option for Lua to ignore those '%'.)

---

function sin(x)
  return %sin(x*180/PI)
end

Will it work in the new version?

-- Milano